### Eclipse Workspace Patch 1.0
#P rules
Index: rules/modules/taxonomy.rules_forms.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/rules/rules/modules/Attic/taxonomy.rules_forms.inc,v
retrieving revision 1.1.2.10
diff -u -r1.1.2.10 taxonomy.rules_forms.inc
--- rules/modules/taxonomy.rules_forms.inc	10 Sep 2009 10:57:54 -0000	1.1.2.10
+++ rules/modules/taxonomy.rules_forms.inc	12 Oct 2010 14:19:59 -0000
@@ -187,6 +187,41 @@
   return $options;
 }
 
+/**
+ * Condition Taxonomy: form to enter a term to check
+ */
+function rules_condition_term_exists_form($settings, &$form) {
+  $form['settings']['term_exists'] = array(
+    '#type' => 'fieldset',
+    '#title' => t('Vocabulary and term definition'),
+  );
+  $options = _rules_action_taxonomy_get_vocab();
+  $options[0] = t('None');
+  $form['settings']['term_exists']['vocab_select'] = array(
+    '#type' => 'select',
+    '#title' => t('Select a vocabulary'),
+    '#options' => $options,
+    '#default_value' => !empty($settings['term_exists']['vocab_select']) ? $settings['term_exists']['vocab_select'] : '',
+    '#description' => t('Select None if any term from any vocabulary is acceptable. Otherwise select the exact vocabulary.'),
+    '#required' => TRUE,
+    '#disabled' => empty($options),
+  );
+  $form['settings']['term_exists']['vocab_text'] = array(
+    '#type' => 'textarea',
+    '#title' => t('Select by vocabulary id'),
+    '#default_value' => !empty($settings['term_exists']['vocab_text']) ? $settings['term_exists']['vocab_text'] : '',
+    '#disabled' => empty($options),
+    '#description' => t('Optional: Enter the vocabulary id (<em>not the vocabulary name</em>) that should be loaded. If this field is used, the "Select a vocabulary" field will be ignored.'),
+  );
+  $form['settings']['term_exists']['term_text'] = array(
+    '#type' => 'textarea',
+    '#title' => t('Enter the name of the term'),
+    '#default_value' => !empty($settings['term_exists']['term_text']) ? $settings['term_exists']['term_text'] : '',
+    '#disabled' => empty($options),
+    '#description' => t('Enter the name of the term to search for. Remember that the case is ignored.'),
+  );
+}
 /**
  * @}
  */
Index: rules/modules/taxonomy.rules.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/rules/rules/modules/Attic/taxonomy.rules.inc,v
retrieving revision 1.1.2.12
diff -u -r1.1.2.12 taxonomy.rules.inc
--- rules/modules/taxonomy.rules.inc	5 Aug 2009 17:20:41 -0000	1.1.2.12
+++ rules/modules/taxonomy.rules.inc	12 Oct 2010 14:19:59 -0000
@@ -57,6 +57,48 @@
 }
 
+/**
+* Implements hook_rules_condition_info().
+*/
+function taxonomy_rules_condition_info() {
+  return array(
+    'rules_condition_term_exists' => array(
+      'label' => t('Term exists'),
+      'eval input' => array('term_exists|vocab_text', 'term_exists|term_text'),
+      'help' => t('Check whether the specified term exists.'),
+      'module' => 'Taxonomy',
+    ),
+  );
+}
+
+/**
+ * Condition: Check if term exists on node.
+ */
+function rules_condition_term_exists($settings) {
+  if ($settings['vocabulary']['vocab_text'] == 'any') {
+    $vid = 0;
+  }
+  else if (!empty($settings['vocabulary']['vocab_text'])) {
+    $vid = $settings['vocabulary']['vocab_text'];
+  }
+  else {
+    $vid = $settings['vocabulary']['vocab_select'];
+  }
+  $term_text = $settings['term_exists']['term_text'];
+  $terms = taxonomy_get_term_by_name($term_text);
+
+  if (!$vid) {
+    // Term of any vocabulary is a match.
+    return count($terms) > 0;
+  }
+  foreach ($terms as $term) {
+    if ($term->vid == $vid) {
+      return TRUE;
+    }
+  }
+  return FALSE;
+}
+
+/**
  * Implementation of hook_rules_action_info().
  */
 function taxonomy_rules_action_info() {
Index: .project
===================================================================
RCS file: .project
diff -N .project
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ .project	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>rules</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+	</buildSpec>
+	<natures>
+	</natures>
+</projectDescription>
