Index: 0.3-stable-modules/proyectos_operativos/proyectos_operativos.module
===================================================================
--- 0.3-stable-modules/proyectos_operativos/proyectos_operativos.module	(revision 9b93a87302256b84bf750f7adfa8fdb49f5aa4ce)
+++ 0.3-stable-modules/proyectos_operativos/proyectos_operativos.module	(revision 4b7848a7786c776546b5a7fc13d8beb1a53ea4e1)
@@ -1881,5 +1881,5 @@
     $inputs[] = $user->entes;
     $inputs[] = variable_get('proyectos_operativos_state_naprobado', NULL);
-    $sql .= "SELECT ac.nid, ac.year, w.sid, n.created, n.title as nombre, u.name, n.uid, e.title AS ente, ctpo.field_proyecto_titulo_value FROM {proyectos_operativos} AS ac INNER JOIN {node} AS n ON n.nid = ac.nid INNER JOIN {users} AS u ON u.uid = n.uid INNER JOIN {node} as e ON e.nid = ac.ente INNER JOIN {workflow_node} AS w ON w.nid = ac.nid LEFT JOIN {content_type_proyectos_operativos} AS ctpo ON ctpo.nid = n.nid AND ctpo.vid = n.vid  WHERE ac.ente = %d AND w.sid <> %d";
+    $sql .= "SELECT ac.nid, ac.year, w.sid, n.created, n.title as nombre, u.name, n.uid, e.title AS ente, ctpo.field_proyecto_titulo_value, ctpo.field_proyecto_codigo_n_etap_value, ctpo.field_proyecto_og_value, ctpo.field_proyecto_justificacion_value FROM {proyectos_operativos} AS ac INNER JOIN {node} AS n ON n.nid = ac.nid INNER JOIN {users} AS u ON u.uid = n.uid INNER JOIN {node} as e ON e.nid = ac.ente INNER JOIN {workflow_node} AS w ON w.nid = ac.nid LEFT JOIN {content_type_proyectos_operativos} AS ctpo ON ctpo.nid = n.nid AND ctpo.vid = n.vid  WHERE ac.ente = %d AND w.sid <> %d";
     $sql_count .= "SELECT COUNT(ac.nid) FROM {proyectos_operativos} AS ac INNER JOIN {node} AS n ON n.nid = ac.nid INNER JOIN {users} AS u ON u.uid = n.uid INNER JOIN {node} as e ON e.nid = ac.ente INNER JOIN {workflow_node} AS w ON w.nid = ac.nid LEFT JOIN {content_type_proyectos_operativos} AS ctpo ON ctpo.nid = n.nid AND ctpo.vid = n.vid  WHERE ac.ente = %d AND w.sid <> %d";
 //    $sql .= "SELECT ac.nid, ac.year, w.sid, n.created, n.title as nombre, u.name, n.uid, e.title AS ente FROM {proyectos_operativos} AS ac INNER JOIN {node} AS n ON n.nid = ac.nid INNER JOIN {users} AS u ON u.uid = n.uid INNER JOIN {node} as e ON e.nid = ac.ente INNER JOIN {workflow_node} AS w ON w.nid = ac.nid WHERE ac.ente = %d AND w.sid <> %d";
@@ -1887,5 +1887,5 @@
   elseif (user_access('admin planificador')) {
     $inputs[] = variable_get('proyectos_operativos_state_naprobado', NULL);
-    $sql .= "SELECT ac.nid, ac.year, ac.ente, w.sid, n.created, n.title as nombre,  u.name, n.uid, e.title AS enten, ctpo.field_proyecto_titulo_value FROM {proyectos_operativos} AS ac INNER JOIN {node} AS n ON n.nid = ac.nid INNER JOIN {users} AS u ON u.uid = n.uid INNER JOIN {node} as e ON e.nid = ac.ente INNER JOIN {workflow_node} AS w ON w.nid = ac.nid  LEFT JOIN {content_type_proyectos_operativos} AS ctpo ON ctpo.nid = n.nid AND ctpo.vid = n.vid WHERE w.sid <> %d";
+    $sql .= "SELECT ac.nid, ac.year, ac.ente, w.sid, n.created, n.title as nombre,  u.name, n.uid, e.title AS enten, ctpo.field_proyecto_titulo_value, ctpo.field_proyecto_codigo_n_etap_value, ctpo.field_proyecto_og_value, ctpo.field_proyecto_justificacion_value FROM {proyectos_operativos} AS ac INNER JOIN {node} AS n ON n.nid = ac.nid INNER JOIN {users} AS u ON u.uid = n.uid INNER JOIN {node} as e ON e.nid = ac.ente INNER JOIN {workflow_node} AS w ON w.nid = ac.nid  LEFT JOIN {content_type_proyectos_operativos} AS ctpo ON ctpo.nid = n.nid AND ctpo.vid = n.vid WHERE w.sid <> %d";
     $sql_count .= "SELECT COUNT(ac.nid) FROM {proyectos_operativos} AS ac INNER JOIN {node} AS n ON n.nid = ac.nid INNER JOIN {users} AS u ON u.uid = n.uid INNER JOIN {node} as e ON e.nid = ac.ente INNER JOIN {workflow_node} AS w ON w.nid = ac.nid  LEFT JOIN {content_type_proyectos_operativos} AS ctpo ON ctpo.nid = n.nid AND ctpo.vid = n.vid WHERE w.sid <> %d";
 //    $sql .= "SELECT ac.nid, ac.year, ac.ente, w.sid, n.created, n.title as nombre,  u.name, n.uid, e.title AS enten FROM {proyectos_operativos} AS ac INNER JOIN {node} AS n ON n.nid = ac.nid INNER JOIN {users} AS u ON u.uid = n.uid INNER JOIN {node} as e ON e.nid = ac.ente INNER JOIN {workflow_node} AS w ON w.nid = ac.nid WHERE w.sid <> %d";
@@ -1921,5 +1921,8 @@
     $cab++;
   }
-  $header[] = array('data' => t('Proyecto')); 
+  $header[] = array('data' => t('Proyecto'));
+  $header[] = array('data' => t('Codigo Nueva Etapa'));
+  $header[] = array('data' => t('Objetivos EspecÃ­ficos'));
+  $header[] = array('data' => t('JustificaciÃ³n'));
   $header[] = array('data' => t('AÃ±o')); 
   $header[] = array('data' => t('Estado')); 
@@ -1930,12 +1933,21 @@
   $rows = array();
   while($ac = db_fetch_object($result)) {
+    $proyect = node_load($ac->nid);
     $row = array();
+    $items = array();
     $color = variable_get('proyectos_operativos_state_color_' . $ac->sid, array());
     if (user_access('admin planificador')) {
       $row[] = array('data' => l($ac->enten, 'node/' . $ac->ente), 'style' => 'background:' . $color, );
     }
+    //lista de los objetivos generales
+    foreach ($proyect->field_proyecto_oe as $item) {
+      $text = substr($item["value"], 0 , 150);
+      $items[] = $text . '...';
+    }
     $nombre_proyecto = $ac->field_proyecto_titulo_value ? $ac->field_proyecto_titulo_value : $ac->nombre;
     $row[] = array('data' => $nombre_proyecto, 'style' => 'background:' . $color, );
-//    $row[] = array('data' => $ac->nombre,);
+    $row[] = array('data' => $ac->field_proyecto_codigo_n_etap_value, 'style' => 'background:' . $color, );
+    $row[] = array('data' => theme('item_list', $items), 'style' => 'background:' . $color, );
+    $row[] = array('data' => $ac->field_proyecto_justificacion_value, 'style' => 'background:' . $color, );
     $row[] = array('data' => $ac->year, 'style' => 'background:' . $color, );
     $estad0 = $ac->sid == $first_state ? t('Ingresado') : $states['states'][$ac->sid];
@@ -1952,5 +1964,6 @@
     $rows[] = $row;
   }
-  $output .= theme('table', $header, $rows);
+  $table_attributes = array('style' => 'width:1400px; margin-left: -200px; margin-top: 30px;');
+  $output .= theme('table', $header, $rows, $table_attributes);
   $output .= theme('pager', NULL);
   if ($fecha) {
@@ -1998,14 +2011,12 @@
     $inputs[] = variable_get('proyectos_operativos_state_naprobado', NULL);
     $inputs[] = variable_get('proyectos_operativos_state_aprobado', NULL);
-    $sql .= "SELECT ac.nid, ac.year, w.sid, n.created, n.title as nombre, u.name, n.uid, e.title AS ente, ctpo.field_proyecto_titulo_value FROM {proyectos_operativos} AS ac INNER JOIN {node} AS n ON n.nid = ac.nid INNER JOIN {users} AS u ON u.uid = n.uid INNER JOIN {node} as e ON e.nid = ac.ente INNER JOIN {workflow_node} AS w ON w.nid = ac.nid LEFT JOIN {content_type_proyectos_operativos} AS ctpo ON ctpo.nid = n.nid AND ctpo.vid = n.vid  WHERE ac.ente = %d AND w.sid <> %d AND w.sid <> %d";
+    $sql .= "SELECT ac.nid, ac.year, w.sid, n.created, n.title as nombre, u.name, n.uid, e.title AS ente, ctpo.field_proyecto_titulo_value, ctpo.field_proyecto_codigo_n_etap_value, ctpo.field_proyecto_og_value, ctpo.field_proyecto_justificacion_value FROM {proyectos_operativos} AS ac INNER JOIN {node} AS n ON n.nid = ac.nid INNER JOIN {users} AS u ON u.uid = n.uid INNER JOIN {node} as e ON e.nid = ac.ente INNER JOIN {workflow_node} AS w ON w.nid = ac.nid LEFT JOIN {content_type_proyectos_operativos} AS ctpo ON ctpo.nid = n.nid AND ctpo.vid = n.vid  WHERE ac.ente = %d AND w.sid <> %d AND w.sid <> %d";
     $sql_count .= "SELECT COUNT(ac.nid) FROM {proyectos_operativos} AS ac INNER JOIN {node} AS n ON n.nid = ac.nid INNER JOIN {users} AS u ON u.uid = n.uid INNER JOIN {node} as e ON e.nid = ac.ente INNER JOIN {workflow_node} AS w ON w.nid = ac.nid LEFT JOIN {content_type_proyectos_operativos} AS ctpo ON ctpo.nid = n.nid AND ctpo.vid = n.vid  WHERE ac.ente = %d AND w.sid <> %d AND w.sid <> %d";
-//    $sql .= "SELECT ac.nid, ac.year, w.sid, n.created, n.title as nombre, u.name, n.uid, e.title AS ente FROM {proyectos_operativos} AS ac INNER JOIN {node} AS n ON n.nid = ac.nid INNER JOIN {users} AS u ON u.uid = n.uid INNER JOIN {node} as e ON e.nid = ac.ente INNER JOIN {workflow_node} AS w ON w.nid = ac.nid WHERE ac.ente = %d AND w.sid <> %d";
   }
   elseif (user_access('admin planificador')) {
     $inputs[] = variable_get('proyectos_operativos_state_naprobado', NULL);
     $inputs[] = variable_get('proyectos_operativos_state_aprobado', NULL);
-    $sql .= "SELECT ac.nid, ac.year, ac.ente, w.sid, n.created, n.title as nombre,  u.name, n.uid, e.title AS enten, ctpo.field_proyecto_titulo_value FROM {proyectos_operativos} AS ac INNER JOIN {node} AS n ON n.nid = ac.nid INNER JOIN {users} AS u ON u.uid = n.uid INNER JOIN {node} as e ON e.nid = ac.ente INNER JOIN {workflow_node} AS w ON w.nid = ac.nid  LEFT JOIN {content_type_proyectos_operativos} AS ctpo ON ctpo.nid = n.nid AND ctpo.vid = n.vid WHERE w.sid <> %d AND w.sid <> %d";
+    $sql .= "SELECT ac.nid, ac.year, ac.ente, w.sid, n.created, n.title as nombre,  u.name, n.uid, e.title AS enten, ctpo.field_proyecto_titulo_value, ctpo.field_proyecto_codigo_n_etap_value, ctpo.field_proyecto_og_value, ctpo.field_proyecto_justificacion_value FROM {proyectos_operativos} AS ac INNER JOIN {node} AS n ON n.nid = ac.nid INNER JOIN {users} AS u ON u.uid = n.uid INNER JOIN {node} as e ON e.nid = ac.ente INNER JOIN {workflow_node} AS w ON w.nid = ac.nid  LEFT JOIN {content_type_proyectos_operativos} AS ctpo ON ctpo.nid = n.nid AND ctpo.vid = n.vid WHERE w.sid <> %d AND w.sid <> %d";
     $sql_count .= "SELECT COUNT(ac.nid) FROM {proyectos_operativos} AS ac INNER JOIN {node} AS n ON n.nid = ac.nid INNER JOIN {users} AS u ON u.uid = n.uid INNER JOIN {node} as e ON e.nid = ac.ente INNER JOIN {workflow_node} AS w ON w.nid = ac.nid  LEFT JOIN {content_type_proyectos_operativos} AS ctpo ON ctpo.nid = n.nid AND ctpo.vid = n.vid WHERE w.sid <> %d AND w.sid <> %d";
-//    $sql .= "SELECT ac.nid, ac.year, ac.ente, w.sid, n.created, n.title as nombre,  u.name, n.uid, e.title AS enten FROM {proyectos_operativos} AS ac INNER JOIN {node} AS n ON n.nid = ac.nid INNER JOIN {users} AS u ON u.uid = n.uid INNER JOIN {node} as e ON e.nid = ac.ente INNER JOIN {workflow_node} AS w ON w.nid = ac.nid WHERE w.sid <> %d";
     $proyectos_operativos_search_ac_ente = isset($_SESSION['proyectos_operativos']) && isset($_SESSION['proyectos_operativos']['ente']) ? $_SESSION['proyectos_operativos']['ente'] : 0;
     if ($proyectos_operativos_search_ac_ente) {
@@ -2039,5 +2050,8 @@
     $cab++;
   }
-  $header[] = array('data' => t('Proyecto')); 
+  $header[] = array('data' => t('Proyecto'));
+  $header[] = array('data' => t('Codigo Nueva Etapa'));
+  $header[] = array('data' => t('Objetivos EspecÃ­ficos'));
+  $header[] = array('data' => t('JustificaciÃ³n'));
   $header[] = array('data' => t('AÃ±o')); 
   $header[] = array('data' => t('Estado')); 
@@ -2049,11 +2063,20 @@
   while($ac = db_fetch_object($result)) {
     $row = array();
+    $items = array();
+    $proyect = node_load($ac->nid);
     $color = variable_get('proyectos_operativos_state_color_' . $ac->sid, array());
     if (user_access('admin planificador')) {
       $row[] = array('data' => l($ac->enten, 'node/' . $ac->ente), 'style' => 'background:' . $color, );
     }
+    //lista de los objetivos generales
+    foreach ($proyect->field_proyecto_oe as $item) {
+      $text = substr($item["value"], 0 , 150);
+      $items[] = $text . '...';
+    }
     $nombre_proyecto = $ac->field_proyecto_titulo_value ? $ac->field_proyecto_titulo_value : $ac->nombre;
     $row[] = array('data' => $nombre_proyecto, 'style' => 'background:' . $color, );
-//    $row[] = array('data' => $ac->nombre,);
+    $row[] = array('data' => $ac->field_proyecto_codigo_n_etap_value, 'style' => 'background:' . $color, );
+    $row[] = array('data' => theme('item_list', $items), 'style' => 'background:' . $color, );
+    $row[] = array('data' => $ac->field_proyecto_justificacion_value, 'style' => 'background:' . $color, );
     $row[] = array('data' => $ac->year, 'style' => 'background:' . $color, );
     $estad0 = $ac->sid == $first_state ? t('Ingresado') : $states['states'][$ac->sid];
@@ -2070,5 +2093,6 @@
     $rows[] = $row;
   }
-  $output .= theme('table', $header, $rows);
+  $table_attributes = array('style' => 'width:1400px; margin-left: -200px; margin-top: 30px;');
+  $output .= theme('table', $header, $rows, $table_attributes);
   $output .= theme('pager', NULL);
   if ($fecha) {
@@ -2804,4 +2828,5 @@
     }
   }
+  $sumas['beneficiarios'] = array();
   if (is_array($field_form) && count($field_form)) {
     module_load_include('inc', 'content', 'includes/content.node_form');
@@ -2830,4 +2855,5 @@
   }
   if (is_array($field_form) && count($field_form)) {
+    $sumas['beneficiarios']['empleos_generados'] = 'empleos_generados';
     module_load_include('inc', 'content', 'includes/content.node_form');
     foreach ($field_form as $field_id) {
@@ -3020,5 +3046,4 @@
     $totales = 0;
     $total_arreglo = array();
-    $sumas['beneficiarios'] = array();
     $vid = variable_get('proyectos_operativos_extra_bene', 0);
     //$terms = taxonomy_get_tree($vid);
@@ -3094,6 +3119,4 @@
     }
     $sumas['beneficiarios']['todosbeneficiarios'] = 'todosbeneficiarios';
-    $sumas['beneficiarios']['empleos_generados'] = 'empleos_generados';
-    drupal_add_js($sumas, 'setting');
     $form['#sumas'] = $sumas;
     $form['beneficiario'][$aux . '_' . $aui]['#suffix'] .= '<td align="center"><div class="todosbeneficiarios_total">' . $totales . '</div></td></tr>';
@@ -3111,4 +3134,7 @@
       ),
     );
+  }
+  if (count($sumas)) {
+    drupal_add_js($sumas, 'setting');
   }
   $field_form = array();
