commit 04c291af500c4451263d5ddcf0305735ccb02289
Author: Dan Chadwick <dan899@gmail.com>
Date:   Fri Jun 12 16:02:15 2015 -0400

     webform-disable_emails-2485371-13.patch

diff --git a/css/webform-admin.css b/css/webform-admin.css
index 520a86c..297f567 100644
--- a/css/webform-admin.css
+++ b/css/webform-admin.css
@@ -147,6 +147,7 @@ html.js div.webform-position {
 tr.webform-add-form .tabledrag-changed {
   display: none;
 }
+#webform-emails tr.webform-add-form,
 #webform-components tr.webform-add-form {
   background-color: inherit;
 }
diff --git a/includes/webform.emails.inc b/includes/webform.emails.inc
index d4356b1..b6c8d4f 100644
--- a/includes/webform.emails.inc
+++ b/includes/webform.emails.inc
@@ -20,6 +20,10 @@ function webform_emails_form($form, $form_state, $node) {
   $form['components'] = array();
 
   foreach ($node->webform['emails'] as $eid => $email) {
+    $form['emails'][$eid]['status'] = array(
+      '#type' => 'checkbox',
+      '#default_value' => $email['status'],
+    );
     $form['emails'][$eid]['email'] = array(
       '#markup' => nl2br(check_plain(implode("\n", webform_format_email_address($email['email'], NULL, $node, NULL, FALSE, FALSE)))),
     );
@@ -29,10 +33,6 @@ function webform_emails_form($form, $form_state, $node) {
     $form['emails'][$eid]['from'] = array(
       '#markup' => check_plain(webform_format_email_address($email['from_address'], $email['from_name'], $node, NULL, FALSE)),
     );
-    $form['emails'][$eid]['status'] = array(
-      '#type' => 'checkbox',
-      '#default_value' => $email['status'],
-    );
   }
 
   $form['add'] = array(
@@ -40,6 +40,11 @@ function webform_emails_form($form, $form_state, $node) {
     '#tree' => FALSE,
   );
 
+  $form['add']['status'] = array(
+    '#type' => 'checkbox',
+    '#default_value' => TRUE,
+  );
+
   $form['add']['email_option'] = array(
     '#type' => 'radios',
     '#options' => array(
@@ -65,17 +70,18 @@ function webform_emails_form($form, $form_state, $node) {
     $form['add']['email_component']['#disabled'] = TRUE;
   }
 
-  $form['actions'] = array(
-    '#type' => 'actions',
-    '#weight' => 45,
-  );
-  $form['actions']['add_button'] = array(
+  $form['add']['add'] = array(
     '#type' => 'submit',
     '#value' => t('Add'),
     '#validate' => array('webform_email_address_validate'),
     '#submit' => array('webform_emails_form_submit'),
   );
-  $form['actions']['save_button'] = array(
+
+  $form['actions'] = array(
+    '#type' => 'actions',
+    '#weight' => 45,
+  );
+  $form['actions']['save'] = array(
     '#type' => 'submit',
     '#value' => t('Save'),
     '#submit' => array('webform_emails_form_status_save'),
@@ -97,17 +103,17 @@ function theme_webform_emails_form($variables) {
   $form = $variables['form'];
   $node = $form['#node'];
 
-  $header = array(t('E-mail to'), t('Subject'), t('From'), t('Status'), array('data' => t('Operations'), 'colspan' => 3));
+  $header = array(t('Send'), t('E-mail to'), t('Subject'), t('From'), array('data' => t('Operations'), 'colspan' => 3));
   $rows = array();
 
   if (!empty($form['emails'])) {
     foreach (element_children($form['emails']) as $eid) {
       // Add each component to a table row.
       $rows[] = array(
+        array('data' => drupal_render($form['emails'][$eid]['status']), 'class' => array('webform-email-status', 'checkbox')),
         drupal_render($form['emails'][$eid]['email']),
         drupal_render($form['emails'][$eid]['subject']),
         drupal_render($form['emails'][$eid]['from']),
-        drupal_render($form['emails'][$eid]['status']),
         l(t('Edit'), 'node/' . $node->nid . '/webform/emails/' . $eid),
         l(t('Clone'), 'node/' . $node->nid . '/webform/emails/' . $eid . '/clone'),
         l(t('Delete'), 'node/' . $node->nid . '/webform/emails/' . $eid . '/delete'),
@@ -119,10 +125,11 @@ function theme_webform_emails_form($variables) {
   }
 
   // Add a row containing form elements for a new item.
+  $add_button = drupal_render($form['add']['add']);
   $row_data = array(
+    array('data' => drupal_render($form['add']['status']), 'class' => array('webform-email-status', 'checkbox')),
     array('colspan' => 3, 'data' => drupal_render($form['add'])),
-    array('colspan' => 2, 'data' => drupal_render($form['add_button'])),
-    array('colspan' => 2, 'data' => drupal_render($form['save_button'])),
+    array('colspan' => 3, 'data' => $add_button),
   );
   $rows[] = array('data' => $row_data, 'class' => array('webform-add-form'));
 
@@ -164,7 +171,7 @@ function webform_emails_form_submit($form, &$form_state) {
   else {
     $email = $form_state['values']['email_component'];
   }
-  $form_state['redirect'] = array('node/' . $form['#node']->nid . '/webform/emails/new', array('query' => array('option' => $form_state['values']['email_option'], 'email' => trim($email))));
+  $form_state['redirect'] = array('node/' . $form['#node']->nid . '/webform/emails/new', array('query' => array('status' => $form_state['values']['status'], 'option' => $form_state['values']['email_option'], 'email' => trim($email))));
 }
 
 /**
@@ -308,8 +315,8 @@ function webform_email_edit_form($form, $form_state, $node, $email = array(), $c
 
   // Add the checkbox to disable the email for current recipients.
   $form['status'] = array(
-    '#title' => t('Status'),
-    '#description' => t('Uncheck to disable the mail sending for current recipients.'),
+    '#title' => t('Enable sending'),
+    '#description' => t('Uncheck to disable sending this email.'),
     '#type' => 'checkbox',
     '#default_value' => $email['status'],
   );
diff --git a/includes/webform.submissions.inc b/includes/webform.submissions.inc
index 7d1c50a..3d2fcee 100644
--- a/includes/webform.submissions.inc
+++ b/includes/webform.submissions.inc
@@ -524,8 +524,8 @@ function webform_submission_resend($form, $form_state, $node, $submission) {
     
     $form['resend'][$eid] = array(
       '#type' => 'checkbox',
-      '#default_value' => $valid_email ? TRUE : FALSE,
-      '#disabled' => $valid_email ? FALSE : TRUE,
+      '#default_value' => $valid_email && $email['status'],
+      '#disabled' => !$valid_email,
     );
     $form['emails'][$eid]['email'] = array(
       '#markup' => nl2br(check_plain(implode("\n", $addresses))),
@@ -596,7 +596,7 @@ function webform_submission_resend_submit($form, &$form_state) {
 function theme_webform_submission_resend($variables) {
   $form = $variables['form'];
 
-  $header = array('', t('E-mail to'), t('Subject'));
+  $header = array(t('Send'), t('E-mail to'), t('Subject'));
   $rows = array();
   if (!empty($form['emails'])) {
     foreach (element_children($form['emails']) as $eid) {
diff --git a/webform.install b/webform.install
index ebd60ba..a43c250 100644
--- a/webform.install
+++ b/webform.install
@@ -2137,7 +2137,7 @@ function webform_update_7423() {
 
   // Rebuild the registry because this point release contains a new class: WebformConditionals.
   registry_rebuild();
-  
+
   return t('Webform database tables were successfully adjusted to allow more than one action for each conditional.');
 }
 
@@ -2272,7 +2272,7 @@ function webform_update_7429() {
 }
 
 /**
- * Add a column to the emails table to set the status of the email sending for the current recipients.
+ * Add a column to the emails table to allow disabling.
  */
 function webform_update_7430() {
   // Add status column to webform_emails.
@@ -2280,12 +2280,13 @@ function webform_update_7430() {
     $spec = array(
       'description' => 'Whether this email is enabled.',
       'type' => 'int',
-      'size' => 'small',
+      'unsigned' => TRUE,
+      'size' => 'tiny',
       'not null' => TRUE,
       'default' => 1,
     );
     db_add_field('webform_emails', 'status', $spec);
   }
 
-  return t('Webform emails may be configured to set the status of email now.');
+  return t('Webform emails may now be disabled.');
 }
diff --git a/webform.module b/webform.module
index 1729ee6..51cc80e 100644
--- a/webform.module
+++ b/webform.module
@@ -514,6 +514,9 @@ function webform_menu_email_load($eid, $nid) {
         $email['email'] = $_GET['email'];
       }
     }
+    if (isset($_GET['status'])) {
+      $email['status'] = $_GET['status'];
+    }
   }
 
   return $email;
