Index: server/pifr_server.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project_issue_file_review/server/pifr_server.install,v
retrieving revision 1.28
diff -u -r1.28 pifr_server.install
--- server/pifr_server.install	7 Aug 2009 05:16:25 -0000	1.28
+++ server/pifr_server.install	15 Aug 2009 05:10:08 -0000
@@ -116,6 +116,41 @@
     ),
     'primary key' => array('branch_id'),
   );
+  $schema['pifr_environment'] = array(
+    'description' => t('Store client environment information.'),
+    'fields' => array(
+      'environment_id' => array(
+        'description' => t('Unique environment ID.'),
+        'type' => 'serial',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+      ),
+      'environment_key' => array(
+        'description' => t('Unique environment key.'),
+        'type' => 'varchar',
+        'not null' => TRUE,
+        'length' => 255,
+        'default' => '',
+      ),
+      'description' => array(
+        'description' => t('Description of environment.'),
+        'type' => 'varchar',
+        'not null' => TRUE,
+        'length' => 255,
+        'default' => '',
+      ),
+      'require_pass' => array(
+        'description' => t('Require the environment to pass in order to pass the review.'),
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+      ),
+    ),
+    'indexes' => array(
+      'environment_key' => array('environment_key'),
+    ),
+    'primary key' => array('environment_id'),
+  );
   $schema['pifr_file'] = array(
     'description' => t('Store file test results.'),
     'fields' => array(
Index: server/pifr_server.menu.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project_issue_file_review/server/pifr_server.menu.inc,v
retrieving revision 1.9
diff -u -r1.9 pifr_server.menu.inc
--- server/pifr_server.menu.inc	18 Jul 2009 06:48:18 -0000	1.9
+++ server/pifr_server.menu.inc	15 Aug 2009 05:10:08 -0000
@@ -36,6 +36,29 @@
     'type' => MENU_CALLBACK,
     'file' => 'pifr_server.test.inc'
   );
+  
+  // Environment management: administrative.
+  $items['admin/pifr/environment/list'] = array(
+    'title' => 'List',
+    'type' => MENU_DEFAULT_LOCAL_TASK,
+    'weight' => -10
+  );
+  $items['admin/pifr/environment/add'] = array(
+    'title' => 'Add',
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('pifr_server_environment_form'),
+    'access arguments' => array('pifr manage environments'),
+    'file' => 'pifr_server.environment.inc',
+    'type' => MENU_LOCAL_TASK,
+  );
+  $items['admin/pifr/environment/edit/%'] = array(
+    'title' => 'Environment',
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('pifr_server_environment_form', 4),
+    'access arguments' => array('pifr manage environments'),
+    'file' => 'pifr_server.environment.inc',
+    'type' => MENU_CALLBACK,
+  );
 
   // Client management: administrative.
   $items['admin/pifr/server'] = array(
Index: server/pifr_server.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project_issue_file_review/server/pifr_server.module,v
retrieving revision 1.43
diff -u -r1.43 pifr_server.module
--- server/pifr_server.module	13 Aug 2009 20:34:06 -0000	1.43
+++ server/pifr_server.module	15 Aug 2009 05:10:08 -0000
@@ -139,7 +139,8 @@
     'pifr add project client',
     'pifr add test client',
     'pifr manage own client',
-    'pifr manage clients'
+    'pifr manage clients',
+    'pifr manage environments',
   );
 }
 
Index: server/views/pifr_server.views_default.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project_issue_file_review/server/views/pifr_server.views_default.inc,v
retrieving revision 1.6
diff -u -r1.6 pifr_server.views_default.inc
--- server/views/pifr_server.views_default.inc	7 Aug 2009 23:01:23 -0000	1.6
+++ server/views/pifr_server.views_default.inc	15 Aug 2009 05:10:08 -0000
@@ -1037,5 +1037,230 @@
 
   $views[$view->name] = $view;
 
+  // ----------------------------------------------------------------
+  // pifr_server_environment
+  
+  $view = new view;
+  $view->name = 'pifr_server_environment';
+  $view->description = '';
+  $view->tag = 'pifr_server';
+  $view->view_php = '';
+  $view->base_table = 'pifr_environment';
+  $view->is_cacheable = FALSE;
+  $view->api_version = 2;
+  $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
+  $handler = $view->new_display('default', 'Defaults', 'default');
+  $handler->override_option('fields', array(
+    'environment_id' => array(
+      'label' => 'Environment ID',
+      'alter' => array(
+        'alter_text' => 0,
+        'text' => '',
+        'make_link' => 0,
+        'path' => '',
+        'link_class' => '',
+        'alt' => '',
+        'prefix' => '',
+        'suffix' => '',
+        'target' => '',
+        'help' => '',
+        'trim' => 0,
+        'max_length' => '',
+        'word_boundary' => 1,
+        'ellipsis' => 1,
+        'strip_tags' => 0,
+        'html' => 0,
+      ),
+      'empty' => '',
+      'hide_empty' => 0,
+      'empty_zero' => 0,
+      'set_precision' => FALSE,
+      'precision' => 0,
+      'decimal' => '.',
+      'separator' => ',',
+      'prefix' => '',
+      'suffix' => '',
+      'exclude' => 0,
+      'id' => 'environment_id',
+      'table' => 'pifr_environment',
+      'field' => 'environment_id',
+      'relationship' => 'none',
+    ),
+    'description' => array(
+      'label' => 'Environment description',
+      'alter' => array(
+        'alter_text' => 0,
+        'text' => '',
+        'make_link' => 0,
+        'path' => '',
+        'link_class' => '',
+        'alt' => '',
+        'prefix' => '',
+        'suffix' => '',
+        'target' => '',
+        'help' => '',
+        'trim' => 1,
+        'max_length' => '150',
+        'word_boundary' => 1,
+        'ellipsis' => 1,
+        'strip_tags' => 0,
+        'html' => 0,
+      ),
+      'empty' => '',
+      'hide_empty' => 0,
+      'empty_zero' => 0,
+      'exclude' => 0,
+      'id' => 'description',
+      'table' => 'pifr_environment',
+      'field' => 'description',
+      'relationship' => 'none',
+    ),
+    'environment_key' => array(
+      'label' => 'Environment key',
+      'alter' => array(
+        'alter_text' => 0,
+        'text' => '',
+        'make_link' => 0,
+        'path' => '',
+        'link_class' => '',
+        'alt' => '',
+        'prefix' => '',
+        'suffix' => '',
+        'target' => '',
+        'help' => '',
+        'trim' => 1,
+        'max_length' => '50',
+        'word_boundary' => 1,
+        'ellipsis' => 1,
+        'strip_tags' => 0,
+        'html' => 0,
+      ),
+      'empty' => '',
+      'hide_empty' => 0,
+      'empty_zero' => 0,
+      'exclude' => 0,
+      'id' => 'environment_key',
+      'table' => 'pifr_environment',
+      'field' => 'environment_key',
+      'relationship' => 'none',
+    ),
+    'require_pass' => array(
+      'label' => 'Require pass',
+      'alter' => array(
+        'alter_text' => 0,
+        'text' => '',
+        'make_link' => 0,
+        'path' => '',
+        'link_class' => '',
+        'alt' => '',
+        'prefix' => '',
+        'suffix' => '',
+        'target' => '',
+        'help' => '',
+        'trim' => 0,
+        'max_length' => '',
+        'word_boundary' => 1,
+        'ellipsis' => 1,
+        'strip_tags' => 0,
+        'html' => 0,
+      ),
+      'empty' => '',
+      'hide_empty' => 0,
+      'empty_zero' => 0,
+      'type' => 'yes-no',
+      'not' => 0,
+      'exclude' => 0,
+      'id' => 'require_pass',
+      'table' => 'pifr_environment',
+      'field' => 'require_pass',
+      'relationship' => 'none',
+    ),
+    'nothing' => array(
+      'label' => 'Operations',
+      'alter' => array(
+        'text' => '<a href="/admin/pifr/environment/edit/[environment_id]">edit</a> | <a href="/admin/pifr/environment/delete/[environment_id]">delete</a>',
+        'make_link' => 0,
+        'path' => '',
+        'link_class' => '',
+        'alt' => '',
+        'prefix' => '',
+        'suffix' => '',
+        'target' => '',
+        'help' => '',
+        'trim' => 0,
+        'max_length' => '',
+        'word_boundary' => 1,
+        'ellipsis' => 1,
+        'strip_tags' => 0,
+        'html' => 0,
+      ),
+      'empty' => '',
+      'hide_empty' => 0,
+      'empty_zero' => 0,
+      'exclude' => 0,
+      'id' => 'nothing',
+      'table' => 'views',
+      'field' => 'nothing',
+      'relationship' => 'none',
+      'override' => array(
+        'button' => 'Override',
+      ),
+    ),
+  ));
+  $handler->override_option('access', array(
+    'type' => 'none',
+  ));
+  $handler->override_option('cache', array(
+    'type' => 'none',
+  ));
+  $handler->override_option('title', 'Environment ');
+  $handler->override_option('style_plugin', 'table');
+  $handler->override_option('style_options', array(
+    'grouping' => '',
+    'override' => 1,
+    'sticky' => 1,
+    'order' => 'asc',
+    'columns' => array(
+      'environment_id' => 'environment_id',
+      'description' => 'description',
+      'environment_key' => 'environment_key',
+      'require_pass' => 'require_pass',
+    ),
+    'info' => array(
+      'environment_id' => array(
+        'sortable' => 1,
+        'separator' => '',
+      ),
+      'description' => array(
+        'separator' => '',
+      ),
+      'environment_key' => array(
+        'separator' => '',
+      ),
+      'require_pass' => array(
+        'sortable' => 1,
+        'separator' => '',
+      ),
+    ),
+    'default' => 'environment_id',
+  ));
+  $handler = $view->new_display('page', 'Environment', 'page_1');
+  $handler->override_option('path', 'admin/pifr/environment');
+  $handler->override_option('menu', array(
+    'type' => 'normal',
+    'title' => 'Environment',
+    'description' => '',
+    'weight' => '0',
+    'name' => 'navigation',
+  ));
+  $handler->override_option('tab_options', array(
+    'type' => 'none',
+    'title' => '',
+    'description' => '',
+    'weight' => 0,
+  ));
+    
+  $views[$view->name] = $view;
+
   return $views;
 }
Index: server/views/pifr_server.views.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project_issue_file_review/server/views/pifr_server.views.inc,v
retrieving revision 1.10
diff -u -r1.10 pifr_server.views.inc
--- server/views/pifr_server.views.inc	18 Jul 2009 07:06:44 -0000	1.10
+++ server/views/pifr_server.views.inc	15 Aug 2009 05:10:08 -0000
@@ -318,6 +318,82 @@
       'label' => t('PIFR test'),
     ),
   );
+  
+  // ----------------------------------------------------------------
+  // pifr_environment table -- basic table information.
+
+  $data['pifr_environment']['table']['group']  = t('PIFR environment');
+
+  $data['pifr_environment']['table']['base'] = array(
+    'field' => 'environment_id',
+    'title' => t('PIFR environment'),
+    'help' => t('Represents a client environment.'),
+    'weight' => -10,
+  );
+
+  $data['pifr_environment']['table']['join'] = array(
+    'pifr_client' => array(
+      'left_field' => 'environment_id',
+      'field' => 'environment_id',
+    ),
+    'pifr_test' => array(
+      'left_field' => 'environment_id',
+      'field' => 'environment_id',
+    ),
+  );
+
+  $data['pifr_environment']['environment_id'] = array(
+    'title' => t('Environment ID'),
+    'help' => t('Unique indentifier given to each environment.'),
+    'field' => array(
+      'handler' => 'views_handler_field_numeric',
+      'click sortable' => TRUE,
+    ),
+    'filter' => array(
+      'handler' => 'views_handler_filter_numeric',
+    ),
+    'sort' => array(
+      'handler' => 'views_handler_sort',
+    ),
+  );
+
+  $data['pifr_environment']['environment_key'] = array(
+    'title' => t('Environment key'),
+    'help' => t('The unique environment key used communicate the environment to the client.'),
+    'field' => array(
+      'handler' => 'views_handler_field',
+    ),
+    'filter' => array(
+      'handler' => 'views_handler_filter_string',
+    ),
+  );
+
+  $data['pifr_environment']['description'] = array(
+    'title' => t('Description'),
+    'help' => t('A clear description of the environment.'),
+    'field' => array(
+      'handler' => 'views_handler_field',
+    ),
+    'filter' => array(
+      'handler' => 'views_handler_filter_string',
+    ),
+  );
+
+  $data['pifr_environment']['require_pass'] = array(
+    'title' => t('Require pass'),
+    'help' => t('Require the environment to pass in order for the test to pass.'),
+    'field' => array(
+     'handler' => 'views_handler_field_boolean',
+     'click sortable' => TRUE,
+    ),
+    'filter' => array(
+      'handler' => 'views_handler_filter_boolean_operator',
+      'label' => t('Require pass'),
+    ),
+    'sort' => array(
+      'handler' => 'views_handler_sort',
+    ),
+  );
 
   // ----------------------------------------------------------------
   // pifr_branch table -- basic table information.
Index: server/pifr_server.environment.inc
===================================================================
RCS file: server/pifr_server.environment.inc
diff -N server/pifr_server.environment.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ server/pifr_server.environment.inc	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,29 @@
+<?php
+// $Id: pifr_server.admin.inc,v 1.10 2009/04/19 09:19:55 boombatower Exp $
+/**
+ * @file
+ * Provide environment management and convience functions.
+ *
+ * Copyright 2008-2009 by Jimmy Berry ("boombatower", http://drupal.org/user/214218)
+ */
+
+function pifr_server_environment_form(&$form_state, $environment_id = NULL) {
+  if ($environment_id) {
+    $environment = pifr_server_environment_get($environment_id);
+  }
+  
+  $form = array();
+  
+  $form['environment'] = array(
+    '#type' => 'fieldset',
+    '#title' => t('Environment'),
+  );
+  
+  return $form;
+}
+
+function pifr_server_environment_get($environment_id) {
+  return db_fetch_array(db_query('SELECT *
+                                   FROM {pifr_environment}
+                                   WHERE environment_id = %d', $environment_id));
+}
