Index: sugarondrupal.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/sugarondrupal/Attic/sugarondrupal.admin.inc,v
retrieving revision 1.1.2.11
diff -u -r1.1.2.11 sugarondrupal.admin.inc
--- sugarondrupal.admin.inc	25 Dec 2010 19:13:58 -0000	1.1.2.11
+++ sugarondrupal.admin.inc	25 Dec 2010 21:33:44 -0000
@@ -207,6 +207,25 @@
   );
 
   /**
+   * Module information
+   */
+  $form['sugarondrupal_mod'] = array(
+    '#type'           => 'fieldset',
+    '#title'          => t('SugarCRM Modules'),
+    '#description'    => t('List of available modules.'),
+  );
+  $rows = array();
+
+  $modules = sugarondrupal_get_available_modules();
+  foreach ($modules as $id => $name) {
+    $rows[] = array(l($name, 'admin/reports/status/sugarcrm/' . $name));
+  }
+  $form['sugarondrupal_mod']['sugarondrupal_modules'] = array(
+    '#type'           => 'markup',
+    '#value'          => theme('table', array(), $rows),
+  );
+
+  /**
    * Dummy placeholder
    */
   $form['sugarondrupal_placeholder'] = array(
@@ -234,4 +253,99 @@
   $path = $data[0] . $path;
 
   return l($text, $path, $options);
-}
\ No newline at end of file
+}
+
+/**
+ * SugarCRM module information status page.
+ *
+ * Show information about...
+ *
+ * @param $name
+ *   Module name to show information about.
+ *
+ * @return
+ *   A form showing current integration status.
+ */
+function sugarondrupal_admin_module_status($form_state, $name = NULL) {
+  $form = array();
+
+  // Go back to SugarCRM status information page if no Module is specified.
+  if (!isset($name)) {
+    drupal_goto('admin/reports/status/sugarcrm');
+  }
+
+  // Get all information available for this module.
+  $params = array(
+    'module_name' => $name,
+    'fields'      => array(),
+  );
+  $info = sugarondrupal_get_module_fields($params);
+
+  if (isset($info['number']) && $info['number'] == 20) {
+    drupal_set_message(t('!message', array('!message' => isset($info['description']) ? $info['description'] : 'Module not available')), 'error');
+    return $form;
+  }
+
+  /**
+   * Module fields.
+   */
+  $form['sugarondrupal_fields'] = array(
+    '#type'           => 'fieldset',
+    '#title'          => t('SugarCRM Module fields'),
+    '#description'    => t('List of available fields for module: !module.', array('!module' => $info['module_name'])),
+  );
+  $rows = array();
+
+  foreach ($info['module_fields'] as $id => $field) {
+    $rows[] = array(
+      $field['label'],
+      $field['name'],
+      $field['type'],
+      $field['required'],
+    );
+  }
+  $header = array(
+    t('Label'),
+    t('Name'),
+    t('Type'),
+    t('Required'),
+  );
+  $form['sugarondrupal_fields']['sugarondrupal_module_fields'] = array(
+    '#type'           => 'markup',
+    '#value'          => theme('table', $header, $rows),
+  );
+
+  /**
+   * Module relations.
+   */
+  $form['sugarondrupal_rela'] = array(
+    '#type'           => 'fieldset',
+    '#title'          => t('SugarCRM Module Relations'),
+    '#description'    => t('List of available relations for module: !module.', array('!module' => $info['module_name'])),
+  );
+  $rows = array();
+
+  foreach ($info['link_fields'] as $id => $link) {
+    $rows[] = array(
+      $link['name'],
+      $link['module'],
+      $link['type'],
+      $link['relationship'],
+      $link['bean_name'],
+    );
+  }
+  $header = array(
+    t('Name'),
+    t('Module'),
+    t('Type'),
+    t('Relationship'),
+    t('Bean Name'),
+  );
+  $form['sugarondrupal_rela']['sugarondrupal_relation_fields'] = array(
+    '#type'           => 'markup',
+    '#value'          => theme('table', $header, $rows),
+  );
+
+  return $form;
+}
+
Index: sugarondrupal.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/sugarondrupal/Attic/sugarondrupal.module,v
retrieving revision 1.1.2.25
diff -u -r1.1.2.25 sugarondrupal.module
--- sugarondrupal.module	24 Dec 2010 11:15:35 -0000	1.1.2.25
+++ sugarondrupal.module	25 Dec 2010 19:25:35 -0000
@@ -59,6 +59,15 @@
     'access arguments'  => array('administer SugarCRM settings'),
     'file'              => 'sugarondrupal.admin.inc',
   );
+  $items['admin/reports/status/sugarcrm/%'] = array(
+    'title'             => 'SugarCRM Module Information',
+    'description'       => 'View detailled SugarCRM module information',
+    'type'              => MENU_CALLBACK,
+    'page callback'     => 'drupal_get_form',
+    'page arguments'    => array('sugarondrupal_admin_module_status', 4),
+    'access arguments'  => array('administer SugarCRM settings'),
+    'file'              => 'sugarondrupal.admin.inc',
+  );
 
   return $items;
 }
@@ -172,6 +181,25 @@
 }
 
 /**
+ * Implementation of get_available_modules sugarcrm webservice
+ *
+ * @param $params associative array of request parameters.
+ *
+ * @return
+ *   an array with the available modules.
+ */
+function sugarondrupal_get_available_modules($params = array()) {
+  // Use existing session id if not specified.
+  $params += array(
+    'session' => sugarondrupal_session_get(),
+  );
+
+  $result = sugarondrupal_sugarcrm_service_request('get_available_modules', $params);
+
+  return isset($result['modules']) ? $result['modules'] : NULL;
+}
+
+/**
  * Return SugarCRM version information from Endpoint.
  *
  * @return

