1 | <?php |
---|
2 | /** |
---|
3 | * Sistema Integral de Planificación y Presupuesto (SIPP) |
---|
4 | * @file reportes_sipp.module |
---|
5 | * Drupal part Module to Sistema Integral de Planificación y Presupuesto (SIPP) |
---|
6 | * Copyright 2013 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 Uzcátegui (diego.uzc [at] gmail [dot] com) |
---|
23 | * @date 2013-04-25 // (año-mes-dia) |
---|
24 | * @version 0.1 // (0.1) |
---|
25 | * |
---|
26 | */ |
---|
27 | |
---|
28 | /* |
---|
29 | * Implementation of hook_menu() |
---|
30 | */ |
---|
31 | function reportes_sipp_menu() { |
---|
32 | $items = array(); |
---|
33 | |
---|
34 | $items['reportes_sipp'] = array( |
---|
35 | 'title' => t('Reportes'), |
---|
36 | 'page callback' => 'reporte_sipp_page', |
---|
37 | 'access callback' => true, |
---|
38 | 'type' => MENU_CALLBACK, |
---|
39 | ); |
---|
40 | |
---|
41 | $items['reportes_sipp/matriz_de_procesos'] = array( |
---|
42 | 'title' => t('MatrÃz de Procesos'), |
---|
43 | 'page callback' => 'matriz_de_procesos_reporte_page', |
---|
44 | 'access callback' => true, |
---|
45 | 'type' => MENU_LOCAL_TASK, |
---|
46 | 'weight' => 1, |
---|
47 | ); |
---|
48 | |
---|
49 | $items['reportes_sipp/matriz_de_procesos/mensual'] = array( |
---|
50 | 'title' => t('MatrÃz de Procesos - Mensual'), |
---|
51 | 'page callback' => 'matriz_de_procesos_reporte_mensual_page', |
---|
52 | 'access callback' => true, |
---|
53 | 'type' => MENU_LOCAL_TASK, |
---|
54 | 'file' => 'includes/matriz_de_procesos_reporte_mensual.pages.inc', |
---|
55 | ); |
---|
56 | |
---|
57 | $items['reportes_sipp/matriz_de_procesos/trimestral'] = array( |
---|
58 | 'title' => t('MatrÃz de Procesos - Trimestral'), |
---|
59 | 'page callback' => 'matriz_de_procesos_reporte_trimestral_page', |
---|
60 | 'access callback' => true, |
---|
61 | 'type' => MENU_LOCAL_TASK, |
---|
62 | 'file' => 'includes/matriz_de_procesos_reporte_trimestral.pages.inc', |
---|
63 | ); |
---|
64 | |
---|
65 | $items['reportes_sipp/resultados_por_unidad_ejecutora'] = array( |
---|
66 | 'title' => t('Resultados por Unidad Ejecutora'),//Mensual |
---|
67 | 'page callback' => 'resultados_por_unidad_ejecutora_reporte_mensual_page', |
---|
68 | 'access callback' => true, |
---|
69 | 'type' => MENU_LOCAL_TASK, |
---|
70 | 'weight' => 2, |
---|
71 | 'file' => 'includes/resultados_por_unidad_ejecutora_reporte_mensual.pages.inc', |
---|
72 | ); |
---|
73 | |
---|
74 | $items['reportes_sipp/reporte_configurado'] = array( |
---|
75 | 'title' => t('Reporte Configurado'), |
---|
76 | 'page callback' => 'reporte_configurado_reporte_page', |
---|
77 | 'access callback' => true, |
---|
78 | 'type' => MENU_LOCAL_TASK, |
---|
79 | 'weight' => 4, |
---|
80 | 'file' => 'includes/reporte_configurado_reporte.pages.inc', |
---|
81 | ); |
---|
82 | //****************************************************************************************** |
---|
83 | $items['reportes_sipp/areas_estrategicas_ministerio'] = array( |
---|
84 | 'title' => t('Ãreas Estratégicas del ministerio'), |
---|
85 | 'page callback' => 'areas_estrategicas_mcti_reporte_page', |
---|
86 | 'access callback' => true, |
---|
87 | 'type' => MENU_LOCAL_TASK, |
---|
88 | 'weight' => 3, |
---|
89 | 'file' => 'includes/aem/aem_reporte.pages.inc', |
---|
90 | ); |
---|
91 | |
---|
92 | $items['reportes_sipp/areas_estrategicas_ministerio/mi'] = array( |
---|
93 | 'title' => t('Microinformes'), |
---|
94 | 'page callback' => 'areas_estrategicas_mcti_reporte_mi_page', |
---|
95 | 'access callback' => true, |
---|
96 | 'type' => MENU_LOCAL_TASK, |
---|
97 | 'weight' => 31, |
---|
98 | 'file' => 'includes/aem/aem_reporte.pages.inc', |
---|
99 | ); |
---|
100 | |
---|
101 | $items['reportes_sipp/areas_estrategicas_ministerio/ci'] = array( |
---|
102 | 'title' => t('Consulta Interactiva'), |
---|
103 | 'page callback' => 'areas_estrategicas_mcti_reporte_ci_page', |
---|
104 | 'access callback' => true, |
---|
105 | 'type' => MENU_LOCAL_TASK, |
---|
106 | 'weight' => 32, |
---|
107 | 'file' => 'includes/aem/aem_reporte.pages.inc', |
---|
108 | ); |
---|
109 | |
---|
110 | $items['reportes_sipp/areas_estrategicas_ministerio/ci/interactivo'] = array( |
---|
111 | 'title' => t('Consulta Interactiva'), |
---|
112 | 'page callback' => 'areas_estrategicas_del_ministerio_reporte_page', |
---|
113 | 'access callback' => true, |
---|
114 | 'type' => MENU_LOCAL_TASK, |
---|
115 | 'file' => 'includes/aem/aem_consulta_interactiva.pages.inc', |
---|
116 | ); |
---|
117 | |
---|
118 | $items['reportes_sipp/areas_estrategicas_ministerio/mi/nuevo_microinforme'] = array( |
---|
119 | 'title' => t('Nuevo Microinforme'), |
---|
120 | 'page callback' => 'areas_estrategicas_del_ministerio_reporte_formulario_microinforme_page', |
---|
121 | //'access callback' => true, |
---|
122 | 'access arguments' => array('admin planificador'), |
---|
123 | 'type' => MENU_LOCAL_TASK, |
---|
124 | ); |
---|
125 | |
---|
126 | $items['reportes_sipp/areas_estrategicas_ministerio/mi/microinforme'] = array( |
---|
127 | 'title' => t('Consulta de Microinforme'), |
---|
128 | 'page callback' => 'aem_consulta_de_microinforme_con_formulario_page', |
---|
129 | 'access callback' => true, |
---|
130 | 'type' => MENU_LOCAL_TASK, |
---|
131 | 'file' => 'includes/aem/aem_listado_y_consulta_microinforme.pages.inc', |
---|
132 | ); |
---|
133 | |
---|
134 | $items['reportes_sipp/areas_estrategicas_ministerio/mi/microinforme/%idmicroinfo'] = array( |
---|
135 | 'title' => t('Consulta de Microinforme'), |
---|
136 | 'page callback' => 'aem_consultar_microinforme_page', |
---|
137 | 'page arguments' => array(4), |
---|
138 | 'access callback' => true, |
---|
139 | 'type' => MENU_CALLBACK, |
---|
140 | 'file' => 'includes/aem/aem_listado_y_consulta_microinforme.pages.inc', |
---|
141 | ); |
---|
142 | |
---|
143 | $items['reportes_sipp/areas_estrategicas_ministerio/mi/microinforme/%regmicroinfo/editar'] = array( |
---|
144 | 'title' => t('Editar Microinforme'), |
---|
145 | 'page callback' => 'aem_editar_microinforme_page', |
---|
146 | 'page arguments' => array(4), |
---|
147 | 'access arguments' => array('admin planificador'), |
---|
148 | 'type' => MENU_CALLBACK, |
---|
149 | 'file' => 'includes/aem/aem_formulario_editar_microinforme.forms.inc', |
---|
150 | ); |
---|
151 | |
---|
152 | $items['reportes_sipp/areas_estrategicas_ministerio/mi/microinforme/%regmicroinfo/eliminar'] = array( |
---|
153 | 'title' => t('Eliminar Microinforme'), |
---|
154 | 'page callback' => 'aem_eliminar_microinforme_page', |
---|
155 | 'page arguments' => array(4), |
---|
156 | 'access arguments' => array('admin planificador'), |
---|
157 | 'type' => MENU_CALLBACK, |
---|
158 | 'file' => 'includes/aem/aem_formulario_eliminar_microinforme.forms.inc', |
---|
159 | ); |
---|
160 | |
---|
161 | $items['reportes_sipp/areas_estrategicas_ministerio/mi/lista_microinformes'] = array( |
---|
162 | 'title' => t('Lista de Microinformes'), |
---|
163 | 'page callback' => 'aem_lista_de_microinforme_page', |
---|
164 | 'access callback' => true, |
---|
165 | 'type' => MENU_LOCAL_TASK, |
---|
166 | 'file' => 'includes/aem/aem_listado_y_consulta_microinforme.pages.inc', |
---|
167 | ); |
---|
168 | |
---|
169 | $items['reportes_sipp/consulta_proyectosoperativos'] = array( |
---|
170 | 'title' => t('Consulta de Proyectos Operativos'), |
---|
171 | 'page callback' => 'consulta_proyectos_operativos_reporte_page', |
---|
172 | 'access callback' => true, |
---|
173 | 'type' => MENU_LOCAL_TASK, |
---|
174 | 'weight' => 5, |
---|
175 | ); |
---|
176 | |
---|
177 | return $items; |
---|
178 | } // function reportes_sipp_menu |
---|
179 | |
---|
180 | |
---|
181 | /** |
---|
182 | * Implementation of hook_views_api(). |
---|
183 | */ |
---|
184 | function reportes_sipp_views_api() { |
---|
185 | return array( |
---|
186 | 'api' => '2.0', |
---|
187 | 'path' => drupal_get_path('module', 'reportes_sipp') . '/views', |
---|
188 | ); |
---|
189 | } |
---|
190 | |
---|
191 | function idmicroinfo_load($id_microinform = 0) { |
---|
192 | settype($id_microinform, "integer"); |
---|
193 | if ($id_microinform >= 0) { |
---|
194 | return $id_microinform; |
---|
195 | } |
---|
196 | return FALSE; |
---|
197 | } |
---|
198 | |
---|
199 | function regmicroinfo_load($id_microinform = 0) { |
---|
200 | settype($id_microinform, "integer"); |
---|
201 | if ($id_microinform >= 0) { |
---|
202 | $sql1 = "SELECT * FROM {microinformes_area_estrategica_mcti} WHERE id_microinforme = %d"; |
---|
203 | $queryResult1 = db_query ( $sql1, $id_microinform); |
---|
204 | $reg_microinform = db_fetch_array ( $queryResult1 ); |
---|
205 | |
---|
206 | return $reg_microinform; |
---|
207 | } |
---|
208 | return FALSE; |
---|
209 | } |
---|
210 | |
---|
211 | |
---|
212 | /* |
---|
213 | * Pagina que muestra los reportes disponibles |
---|
214 | * Implementado por: Ing. Diego Uzcátegui, |
---|
215 | * Inicio de codificación: 30-05-13 |
---|
216 | */ |
---|
217 | function reporte_sipp_page(){ |
---|
218 | |
---|
219 | $path_modulo_menu_principal = drupal_get_path('module', 'principal_inicio_sipp'); |
---|
220 | |
---|
221 | //reportes disponibles |
---|
222 | $page_content .= '<br><br>'; |
---|
223 | $page_content .= '<h4>Reportes</h4>'; |
---|
224 | $page_content .= '<table align=\"center\" border=\"0\"><tr>'; |
---|
225 | |
---|
226 | $image_tag = theme_image($path_modulo_menu_principal.'/img/reportes/matrizprocesos.png').'<br>'.'<b>'.t('Matriz de Procesos').'</b>'; |
---|
227 | $page_content .= "<td width=\"20%\" align=\"center\">".l($image_tag, 'reportes_sipp/matriz_de_procesos', array('html'=>TRUE))."</td>"; |
---|
228 | |
---|
229 | $image_tag = theme_image($path_modulo_menu_principal.'/img/reportes/unidadejecutora.png').'<br>'.'<b>'.t('Resultados por Unidad Ejecutora').'</b>'; |
---|
230 | $page_content .= "<td width=\"20%\" align=\"center\">".l($image_tag, 'reportes_sipp/resultados_por_unidad_ejecutora', array('html'=>TRUE))."</td>"; |
---|
231 | |
---|
232 | $image_tag = theme_image($path_modulo_menu_principal.'/img/reportes/areasestrategicasdelministerio.png').'<br>'.'<b>'.t('Areas Estratégicas del Ministerio').'</b>'; |
---|
233 | $page_content .= "<td width=\"20%\" align=\"center\">".l($image_tag, 'reportes_sipp/areas_estrategicas_ministerio', array('html'=>TRUE))."</td>"; |
---|
234 | |
---|
235 | $image_tag = theme_image($path_modulo_menu_principal.'/img/reportes/reportesconfigurados.png').'<br>'.'<b>'.t('Reportes Configurados').'</b>'; |
---|
236 | $page_content .= "<td width=\"20%\" align=\"center\">".l($image_tag, 'reportes_sipp/reporte_configurado', array('html'=>TRUE))."</td>"; |
---|
237 | |
---|
238 | $image_tag = theme_image($path_modulo_menu_principal.'/img/reportes/consultadeproyectos.png').'<br>'.'<b>'.t('Consultas de Proyectos').'</b>'; |
---|
239 | $page_content .= "<td width=\"20%\" align=\"center\">".l($image_tag, 'reportes_sipp/consulta_de_proyectos', array('html'=>TRUE))."</td>"; |
---|
240 | |
---|
241 | $page_content .= '</tr></table>'; |
---|
242 | $page_content .= '<br><br>'; |
---|
243 | |
---|
244 | return $page_content; |
---|
245 | } |
---|
246 | |
---|
247 | |
---|
248 | /* |
---|
249 | * Pagina que muestra el reporte de matriz de procesos |
---|
250 | * Implementado por: Ing. Diego Uzcátegui, |
---|
251 | * Inicio de codificación: 25-04-13 |
---|
252 | */ |
---|
253 | |
---|
254 | function matriz_de_procesos_reporte_page(){ |
---|
255 | |
---|
256 | $page_content = '<br>'; |
---|
257 | |
---|
258 | $page_content .= '<br><br>'; |
---|
259 | $page_content .= '<table align=\"center\" border=\"0\"><tr>'; |
---|
260 | $page_content .= "<td width=\"50%\" align=\"center\">"."<b>".l(t('Matriz de procesos Mensual'), 'reportes_sipp/matriz_de_procesos/mensual')."</b></td>"; |
---|
261 | $page_content .= "<td width=\"50%\" align=\"center\">"."<b>".l(t('Matriz de procesos Trimestral'), 'reportes_sipp/matriz_de_procesos/trimestral')."</b></td>"; |
---|
262 | $page_content .= '</tr></table>'; |
---|
263 | $page_content .= '<br><br>'; |
---|
264 | |
---|
265 | return $page_content; |
---|
266 | } |
---|
267 | |
---|
268 | |
---|
269 | |
---|
270 | function consulta_proyectos_operativos_reporte_page(){ |
---|
271 | |
---|
272 | $page_content = '<br>'; |
---|
273 | |
---|
274 | $page_content .= '<br><br>'; |
---|
275 | $page_content .= '<table align=\"center\" border=\"0\"><tr>'; |
---|
276 | $page_content .= "<td width=\"100%\" align=\"center\">"."<b>".l(t('Consulta de Proyectos Operativos'), 'reportes_sipp/consulta_de_proyectos')."</b></td>"; |
---|
277 | $page_content .= '</tr></table>'; |
---|
278 | $page_content .= '<br><br>'; |
---|
279 | |
---|
280 | return $page_content; |
---|
281 | } |
---|
282 | |
---|
283 | |
---|
284 | |
---|
285 | //incluir funciones que consultan solo datos aprobados |
---|
286 | module_load_include('inc', 'reportes_sipp' , 'includes/funciones_consulta_bd_proyecto_solo_aprobado.pages'); |
---|
287 | |
---|
288 | //module_load_include('inc', 'reportes_sipp' , 'includes/areas_estrategicas_del_ministerio_reporte_formulario_microinforme.forms'); |
---|
289 | module_load_include('inc', 'reportes_sipp' , 'includes/aem/aem_formulario_microinforme.forms'); |
---|