diff --git a/pift.module b/pift.module
index d173a6e..b4fe818 100644
--- a/pift.module
+++ b/pift.module
@@ -651,3 +651,176 @@ function pift_compatibility_list() {
 
   return $compatibility_list;
 }
+
+/**
+ * Implements hook_extended_file_field_metadata_types().
+ *
+ * Defines additional PIFT metadata properties for the extended file field
+ * formatter and widget, including the associated 'Test ID', 'Test Status',
+ * 'Test Message' and 'Test Operations' information for a given file.
+ */
+function pift_extended_file_field_metadata_types() {
+  return array(
+    'pift_id' => array(
+      'title' => t('Test ID'),
+      'sort' => 'numeric',
+      'formatter' => 'pift_extended_file_field_testid_formatter',
+    ),
+    'pift_status' => array(
+      'title' => t('Test Status'),
+      'sort' => 'string',
+      'formatter' => 'pift_extended_file_field_status_formatter',
+    ),
+    'pift_message' => array(
+      'title' => t('Test Summary'),
+      'sort' => 'string',
+      'formatter' => 'pift_extended_file_field_message_formatter',
+    ),
+    'pift_operations' => array(
+      'title' => t('Operations'),
+      'sort' => FALSE,
+      'formatter' => 'pift_extended_file_field_operations_formatter',
+    ),
+  );
+}
+
+/**
+ * Implementation of hook_extended_file_field_items_alter().
+ *
+ * Adds PIFT related metadata (including test id, test result, and test
+ * operations) to the file $items array within fields using the
+ * extended_file_field field formatter.
+ *
+ * @param array $items
+ *   The array of file items from the field, keyed by file ID (fid).
+ * @param array $context
+ *   Associative array of context for the table of files being altered, with
+ *   the following keys:
+ *   - field: The field definition array.
+ *   - instance: The field instance definition array.
+ *   - entity: An object representing the entity the file field is attached to.
+ *   - entity_type: String with the type of entity the field is attached to.
+ *   - langcode: The language associated with $items.
+ *   - display: The display settings to use, as found in the 'display' entry of
+ *     the instance definition. Notable keys include the name of the formatter
+ *     (in 'type') and the array of formatter settings (in 'settings').
+ *
+ *  @see drupal_alter()
+
+ */
+function pift_extended_file_field_items_alter(&$items, &$context) {
+  // Add a 'Test ID' property to each item in the $items array.
+  $fids = array_keys($items);
+  $test_ids = pift_test_get_test_ids($fids);
+  $tests = pift_test_get_test_summary_multiple($test_ids);
+
+  $retest = user_access('pift re-test files');
+
+  foreach ($items as $key => $value) {
+    // Add the test id associated with each file to the $items array.
+    // If no test_id is found for a given file, set it to '0'.
+    $test_id = isset($test_ids[$value['fid']]) ? $test_ids[$value['fid']] : 0;
+    $items[$key]['pift_id'] = $test_id;
+    $items[$key]['pift_status'] = !empty($test_id) ? $tests[$test_id]['status'] : 0;
+    $items[$key]['pift_message'] = !empty($test_id) ? $tests[$test_id]['message'] : 0;
+    $items[$key]['pift_operations'] = !empty($test_id) ? array('view' => $test_id) : array();
+    if ($retest && !empty($test_id) && in_array($tests[$test_id]['status'], array(PIFT_STATUS_FAIL, PIFT_STATUS_PASS))) {
+      $items[$key]['pift_operations']['retest'] = $test_id;
+    }
+  }
+}
+
+/**
+ * Implementation of hook_extended_file_field_widget_items_alter().
+ *
+ * Adds PIFT related metadata (including test id, test result, and test
+ * operations) to the file $items array within fields using the
+ * extended_file_field field widget.
+ *
+ * @param array $items
+ *   The array of file items from the field, keyed by file ID (fid).
+ * @param array $context
+ *   Associative array of context for the table of files being altered, with
+ *   the following keys:
+ *   - field: The field definition array.
+ *   - instance: The field instance definition array.
+ *   - entity: An object representing the entity the file field is attached to.
+ *   - entity_type: String with the type of entity the field is attached to.
+ *   - langcode: The language associated with $items.
+ *   - display: The display settings to use, as found in the 'display' entry of
+ *     the instance definition. Notable keys include the name of the formatter
+ *     (in 'type') and the array of formatter settings (in 'settings').
+ *
+ *  @see drupal_alter()
+ */
+function pift_extended_file_field_widget_items_alter(&$items, &$context) {
+  pift_extended_file_field_items_alter($items, $context);
+}
+
+/**
+ * Generates the 'file test_id' column for a given file.
+ *
+ * If the file has a valid test entry in the 'pift_id' property, this
+ * function renders it.
+ */
+function pift_extended_file_field_testid_formatter($file, $context) {
+  return !empty($file['pift_id']) ? check_plain($file['pift_id']) : array();
+}
+
+
+/**
+ * Generates the 'file status' column for a given file.
+ *
+ * If the file has a valid test entry in the 'pift_status' property, this
+ * function renders the human-readable version of the test status.
+ */
+function pift_extended_file_field_status_formatter($file, $context) {
+  if (!empty($file['pift_id'])) {
+    list($cell, $class) = pift_attachment_process($file['pift_status'], (bool) $file['pift_message']);
+    $data = array('data' => $cell, 'class' => $class);
+  }
+  return (!empty($data)) ? $data : array();
+}
+
+/**
+ * Generates the 'file message' column for a given file.
+ *
+ * If the file has a valid test entry in the 'pift_status' property, this
+ * function renders the human-readable version of the test status.
+ */
+function pift_extended_file_field_message_formatter($file, $context) {
+  if (!empty($file['pift_id'])) {
+    list($cell, $class) = pift_attachment_process($file['pift_status'], (bool) $file['pift_message']);
+
+    $message = $file['pift_message'] ? check_plain($file['pift_message']) : '<em>' . t('None') . '</em>';
+
+    // If file is being re-tested then prefix the previous result message.
+    if ($file['pift_message'] && $file['pift_status'] == PIFT_STATUS_QUEUE) {
+      $message = t('Previous result: ') . $message;
+    }
+
+    $data = array('data' => $message, 'class' => $class);
+  }
+  return (!empty($data)) ? $data : array();
+}
+
+/**
+ * Generates the 'file operations' column for a given file.
+ *
+ * If the file has a valid test entry in the pift_test table, this function
+ * renders the 'view test' and 're-test' links used to manage testing for the
+ * file.
+ */
+function pift_extended_file_field_operations_formatter($file, $context) {
+  if (!empty($file['pift_id'])) {
+    foreach ($file['pift_operations'] as $op => $test_id) {
+      if ($op = 'view') {
+        $links[] = pift_test_view_link($test_id);
+      }
+      elseif ($op = 'retest') {
+        $links[] = pift_test_retest_link($test_id);
+      }
+    }
+  }
+  return !empty($links) ? explode(' | ', $links) : array();
+}
diff --git a/pift.test.inc b/pift.test.inc
index f36aab4..6f66455 100644
--- a/pift.test.inc
+++ b/pift.test.inc
@@ -8,10 +8,25 @@
  */
 
 /**
+ * Determine whether a given test_id is valid
+ *
+ * @param integer $test_id
+ *
+ * @return boolean
+ *   TRUE if the test exists in {pift_test}, or FALSE if not.
+ */
+function pift_test_exists($test_id) {
+  $exists = db_query('SELECT COUNT(test_id) FROM {pift_test} WHERE test_id = :testid',
+    array(':testid' => $test_id))
+    ->fetchField();
+  return !empty($exists);
+}
+
+/**
  * Get basic test info for a given test_id
  */
 function pift_test_get_test_summary($test_id) {
-  return db_query('SELECT test_id, type, id, status, message, last_tested FROM {pift_test} where test_id = :testid',
+  return db_query('SELECT test_id, type, id, status, message, last_tested FROM {pift_test} WHERE test_id = :testid',
     array(':testid' => $test_id),
     array('fetch' => PDO::FETCH_ASSOC))
     ->fetchAllAssoc('test_id');
@@ -21,7 +36,7 @@ function pift_test_get_test_summary($test_id) {
  * Get basic test info for a given array of test_ids
  */
 function pift_test_get_test_summary_multiple($test_ids) {
-  return db_query('SELECT test_id, type, id, status, message, last_tested FROM {pift_test} where test_id IN (:testids)',
+  return db_query('SELECT test_id, type, id, status, message, last_tested FROM {pift_test} WHERE test_id IN (:testids)',
     array(':testids' => $test_ids),
     array('fetch' => PDO::FETCH_ASSOC))
     ->fetchAllAssoc('test_id');
@@ -302,3 +317,17 @@ function pift_test_delete_files() {
 //    }
 //  }
 //}
+
+/**
+ * Generates the 'view details' link for a given test_id.
+ */
+function pift_test_view_link($test_id) {
+  return l(t('View details'), variable_get('pift_server', 'http://example.com') . '/pifr/test/' . check_plain($test_id));
+}
+
+/**
+ * Generates the 'Re-test' link for a given test_id.
+ */
+function pift_test_retest_link($test_id) {
+  return l(t('Re-test'), 'pift/retest/' . check_plain($test_id));
+}
