1 | <?php |
---|
2 | /** |
---|
3 | * Sistema Automatizado para la Planificación Estratégico-Situacional en la Administración Pública Venezolana |
---|
4 | * @file proyecto_operativo_seguimiento.module |
---|
5 | * Drupal part Module to code proyectos operativos module |
---|
6 | * Copyright 2012 Sistema Automatizado para la Planificación Estratégico-Situacional en la Administración Pública Venezolana (CENDITEL) |
---|
7 | * |
---|
8 | * This program is free software; you can redistribute it and/or modify |
---|
9 | * it under the terms of the GNU General Public License as published by |
---|
10 | * the Free Software Foundation; either version 2 of the License, or |
---|
11 | * (at your option) any later version. |
---|
12 | * |
---|
13 | * This program is distributed in the hope that it will be useful, |
---|
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
16 | * GNU General Public License for more details. |
---|
17 | * |
---|
18 | * You should have received a copy of the GNU General Public License |
---|
19 | * along with this program; if not, write to the Free Software |
---|
20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
---|
21 | * |
---|
22 | * @author CENDITEL Merida - Ing. Diego Uzcategui |
---|
23 | * @date 2013-02-07 // (anno-mes-dia) |
---|
24 | * @author CENDITEL Merida - Phd Juan Vizcarrondo (Actualizacion de funciones) |
---|
25 | * @update 2016-12-14 // (anno-mes-dia) |
---|
26 | * @version 0.1 |
---|
27 | * |
---|
28 | */ |
---|
29 | |
---|
30 | /** |
---|
31 | * Pagina que muestra el historial de cambios de estados |
---|
32 | * revisado 1 abril 2013 |
---|
33 | */ |
---|
34 | function historial_cambiodeestado_seg_proyecto_page($node, $mes = 0) { |
---|
35 | if (_proyecto_seguimiento_mes_mover_estado_access($node, $mes_fase_seg, $message = true)); |
---|
36 | $meses = json_decode(MESES); |
---|
37 | |
---|
38 | $output = ''; |
---|
39 | $output .= '<br>'; |
---|
40 | $tablas = array(); |
---|
41 | $header = array(); |
---|
42 | $header[] = array('data' => t('Mes')); |
---|
43 | $header[] = array('data' => t('Accionado')); |
---|
44 | $header[] = array('data' => t('Fecha')); |
---|
45 | $header[] = array('data' => t('Actor')); |
---|
46 | $header[] = array('data' => t('Comentario')); |
---|
47 | $header[] = array('data' => t('Transición de Estados')); |
---|
48 | //............. |
---|
49 | $mes_seguimiento = variable_get('accion_especifica_de_proyecto_seguimiento_mes_seguimiento', 0); |
---|
50 | $mes_final = variable_get('seguimiento_proyectos_cantidad_meses_seguimiento', 0); |
---|
51 | $rows = array(); |
---|
52 | for ($i=($mes_seguimiento -1); $i<=$mes_final; $i++) { |
---|
53 | $mesesList .= ' ' . $meses[$i]; |
---|
54 | $query = "SELECT id_seg from {seguimiento_proyecto} where nid = %d and mes = %d";//consulta seguimiento |
---|
55 | $queryResult = db_query ($query, $node->nid, $i); |
---|
56 | $seg_proyecto = db_fetch_object($queryResult); |
---|
57 | $query2 = "SELECT t.*, u.name from {seguimiento_proyecto_transiciones_estados} AS t LEFT JOIN {users} AS u ON u.uid = t.uid where t.id_seg = %d order by date desc";//consulta seguimiento |
---|
58 | $queryResult2 = db_query($query2, $seg_proyecto->id_seg); |
---|
59 | $estados = _obtener_estados_seguimiento_mes(); |
---|
60 | |
---|
61 | while ($transiciones_estado_seg = db_fetch_object ($queryResult2)) { |
---|
62 | $row = array(); |
---|
63 | $row[] = array('data' => $meses[$i],); |
---|
64 | $estado_anterior = isset($transiciones_estado_seg->estado_ant)? $transiciones_estado_seg->estado_ant : '-'; |
---|
65 | $estado_anterior_nombre = $estados['states'][$estado_anterior]; |
---|
66 | $estado_actual = isset($transiciones_estado_seg->estado)? $transiciones_estado_seg->estado : '-'; |
---|
67 | $estado_actual_nombre = $estados['states'][$estado_actual]; |
---|
68 | $accionado = variable_get('proyectos_operativos_state_d_' . $current . '_' . $transiciones_estado_seg->estado, FALSE)? t(variable_get('proyectos_operativos_state_tdevueltos', 'Devuelto a @state'), array('@state' => $estado_actual_nombre)) : t(variable_get('proyectos_operativos_state_tndevueltos', 'Enviado a @state'), array('@state' => $estado_actual_nombre)); |
---|
69 | $row[] = array('data' => $accionado,); |
---|
70 | $fecha_cambio_estado = isset($transiciones_estado_seg->date)? $transiciones_estado_seg->date : '-'; |
---|
71 | $fecha_formato_cambio_estado = format_date($fecha_cambio_estado); |
---|
72 | $row[] = array('data' => $fecha_formato_cambio_estado,); |
---|
73 | $row[] = array('data' => $transiciones_estado_seg->name,); |
---|
74 | $comentario = isset($transiciones_estado_seg->comentario)? $transiciones_estado_seg->comentario : '-'; |
---|
75 | $row[] = array('data' => $comentario,); |
---|
76 | $row[] = array('data' => $estado_anterior_nombre.' => '.$estado_actual_nombre,); |
---|
77 | $rows[] = $row; |
---|
78 | } |
---|
79 | } |
---|
80 | drupal_set_title(t('Historial de cambios de estados del Seguimiento de Proyecto para el mes "@nombre_mes"', array('@nombre_mes' => $mesesList))); |
---|
81 | |
---|
82 | //....................... |
---|
83 | $tablas[]= theme('table', $header, $rows); |
---|
84 | if (count($tablas)) { |
---|
85 | $output .= '<fieldset><legend>' . t('Historial transiciones de cambio de estado del seguimiento del Proyecto') . '</legend>'; |
---|
86 | $output .= implode('', $tablas).'</fieldset>'; |
---|
87 | } |
---|
88 | return $output; |
---|
89 | } |
---|