1 | <?php |
---|
2 | /** |
---|
3 | * Sistema Integral de Planificación y Presupuesto (SIPP) |
---|
4 | * @file proyectos-operativos-ficha-proyecto.tpl.php |
---|
5 | * Drupal part Module to Sistema Integral de Planificación y Presupuesto (SIPP) |
---|
6 | * Copyright 2011 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 - Msc. Juan Vizcarrondo |
---|
23 | * @date 2013-08-02 // (año-mes-dia) |
---|
24 | * @version 0.1 // (0.1) |
---|
25 | */ |
---|
26 | |
---|
27 | $node_type = content_types('proyectos_operativos'); |
---|
28 | $campos_proyectos = $node_type['fields']; |
---|
29 | $content = node_build_content($proyecto); |
---|
30 | $format_number = array( |
---|
31 | 'decimals' => variable_get('proyectos_operativos_number_decimals', 0), |
---|
32 | 'dec_point' => variable_get('proyectos_operativos_number_dec_point', ','), |
---|
33 | 'thousands_sep' => variable_get('proyectos_operativos_number_thousands_sep', '.'), |
---|
34 | ); |
---|
35 | ?> |
---|
36 | |
---|
37 | <h2><?php print t('Datos Básicos');?></h2> |
---|
38 | <h3><?php print t('Datos Básicos de Identificación del Proyecto');?></h3> |
---|
39 | <div class="field field-type-text field-field-proyecto-titulo"> |
---|
40 | <div class="field-label"><?php print t('Nombre del Proyecto');?>: </div> |
---|
41 | <div class="field-items"> |
---|
42 | <div class="field-item odd"> <?php print check_plain($proyecto->titulo_asignado); ?> </div> |
---|
43 | </div> |
---|
44 | </div> |
---|
45 | <?php |
---|
46 | $arreglo = array( |
---|
47 | 'field_proyecto_codigo' => 'field_proyecto_codigo', |
---|
48 | 'field_proyecto_fecha_i' => 'field_proyecto_fecha_i', |
---|
49 | 'field_proyecto_fecha_f' => 'field_proyecto_fecha_f', |
---|
50 | 'field_proyecto_status' => 'field_proyecto_status', |
---|
51 | 'field_proyecto_situacion_p' => 'field_proyecto_situacion_p', |
---|
52 | 'field_proyecto_plurianual' => 'field_proyecto_plurianual', |
---|
53 | 'field_proyecto_monto_anual' => 'field_proyecto_monto_anual', |
---|
54 | 'field_proyecto_total' => 'field_proyecto_total', |
---|
55 | 'field_proyecto_poan' => 'field_proyecto_poan', |
---|
56 | ); |
---|
57 | if (module_exists('proyectos_reformulacion')) { |
---|
58 | $arreglo['field_proyecto_monto_anual'] = 'proyectos_operativos_monto_anual_reformulado'; |
---|
59 | $arreglo['field_proyecto_total'] = 'proyectos_operativos_monto_total_reformulado'; |
---|
60 | } |
---|
61 | ?> |
---|
62 | <?php foreach($arreglo as $campo): ?> |
---|
63 | <?php print drupal_render($content->content[$campo]); ?> |
---|
64 | <?php endforeach ?> |
---|
65 | <h3><?php print t('Gerente del Proyecto');?></h3> |
---|
66 | <?php print drupal_render($content->content['field_proyecto_ente']); ?> |
---|
67 | <?php |
---|
68 | $arreglo = array( |
---|
69 | 'field_proyecto_autoridad' => 'field_proyecto_autoridad', |
---|
70 | 'field_proyecto_lider' => 'field_proyecto_lider', |
---|
71 | 'field_proyecto_unidad_a' => 'field_proyecto_unidad_a', |
---|
72 | 'field_proyecto_cargo' => 'field_proyecto_cargo', |
---|
73 | 'field_proyecto_telefono' => 'field_proyecto_telefono', |
---|
74 | 'field_proyecto_correo' => 'field_proyecto_correo', |
---|
75 | ); |
---|
76 | ?> |
---|
77 | <?php foreach($arreglo as $campo): ?> |
---|
78 | <?php print drupal_render($content->content[$campo]); ?> |
---|
79 | <?php endforeach ?> |
---|
80 | <?php |
---|
81 | $pndes = variable_get('proyectos_operativos_muestra_pndes', TRUE); |
---|
82 | $mcti = variable_get('proyectos_operativos_muestra_mcti', TRUE); |
---|
83 | if ($pndes || $mcti) { |
---|
84 | print '<h3>' . t('Ãrea Estrategica') . '</h3>'; |
---|
85 | if ($pndes) { |
---|
86 | print drupal_render($content->content['field_proyecto_pndes']); |
---|
87 | } |
---|
88 | if ($mcti) { |
---|
89 | print drupal_render($content->content['field_proyecto_mcti']); |
---|
90 | } |
---|
91 | } |
---|
92 | ?> |
---|
93 | <h2><?php print t('Datos Generales');?></h2> |
---|
94 | <h3><?php print t('Clasificación Sectorial');?></h3> |
---|
95 | <?php print drupal_render($content->content['field_proyecto_sector']); ?> |
---|
96 | <?php if(variable_get('proyectos_operativos_muestra_talento', TRUE)) : ?> |
---|
97 | <h2><?php print t('Talento Humano');?></h2> |
---|
98 | <?php |
---|
99 | $arreglo = array( |
---|
100 | 'field_proyecto_institucionth' => 'field_proyecto_institucionth', |
---|
101 | 'field_proyecto_nombres_a' => 'field_proyecto_nombres_a', |
---|
102 | 'field_proyecto_cargo_th' => 'field_proyecto_cargo_th', |
---|
103 | 'field_proyecto_rol_th' => 'field_proyecto_rol_th', |
---|
104 | 'field_proyecto_esfuerzo' => 'field_proyecto_esfuerzo', |
---|
105 | 'field_proyecto_formacion' => 'field_proyecto_formacion', |
---|
106 | ); |
---|
107 | $header = array(); |
---|
108 | foreach($arreglo as $campo) { |
---|
109 | $header[] = array('data' => check_plain($campos_proyectos[$campo]['widget']['label']), 'align' => 'center'); |
---|
110 | } |
---|
111 | $tamano_array = array(); |
---|
112 | foreach($arreglo as $field_id => $field) { |
---|
113 | $tamano_array[] = count($proyecto->{$field_id}); |
---|
114 | } |
---|
115 | $cantidad_talento = max($tamano_array); |
---|
116 | $rows = array(); |
---|
117 | for ($i = 0; $i < $cantidad_talento; $i++) { |
---|
118 | $row = array(); |
---|
119 | foreach($arreglo as $campo) { |
---|
120 | $valor_d = ($campo == 'field_proyecto_esfuerzo') ? 0 : ''; |
---|
121 | $valor = isset($proyecto->{$campo}[$i]) ? $proyecto->{$field_id}[$i]['value'] : $valor_d; |
---|
122 | $row[] = array('data' => check_plain($valor), 'align' => 'center',); |
---|
123 | } |
---|
124 | $rows[] = $row; |
---|
125 | } |
---|
126 | if (!count($rows)) { |
---|
127 | $row[] = array('data' => t('No se ha ingresado la sección de Talento Humano'), 'colspan' => count($header), 'align' => 'center'); |
---|
128 | $rows[] = $row; |
---|
129 | } |
---|
130 | print theme('table', $header, $rows, array('border' => '1')); |
---|
131 | ?> |
---|
132 | <?php endif; ?> |
---|
133 | <?php if (variable_get('proyectos_operativos_muestra_capacidades', TRUE)): ?> |
---|
134 | <h3><?php print t('Capacidades');?></h3> |
---|
135 | <?php |
---|
136 | $arreglo = array( |
---|
137 | 'field_proyecto_institucion_alc' => 'field_proyecto_institucion_alc', |
---|
138 | 'field_proyecto_infraestructura' => 'field_proyecto_infraestructura', |
---|
139 | 'field_proyecto_equipos' => 'field_proyecto_equipos', |
---|
140 | 'field_proyecto_insumos' => 'field_proyecto_insumos', |
---|
141 | 'field_proyectos_servicios' => 'field_proyectos_servicios', |
---|
142 | ); |
---|
143 | $header = array(); |
---|
144 | foreach($arreglo as $campo) { |
---|
145 | $header[] = array('data' => check_plain($campos_proyectos[$campo]['widget']['label']), 'align' => 'center'); |
---|
146 | } |
---|
147 | $tamano_array = array(); |
---|
148 | foreach($arreglo as $field_id => $field) { |
---|
149 | $tamano_array[] = count($proyecto->{$field_id}); |
---|
150 | } |
---|
151 | $cantidad_talento = max($tamano_array); |
---|
152 | $rows = array(); |
---|
153 | for ($i = 0; $i < $cantidad_talento; $i++) { |
---|
154 | $row = array(); |
---|
155 | foreach($arreglo as $campo) { |
---|
156 | $valor_d = ($campo == 'field_proyecto_esfuerzo') ? 0 : ''; |
---|
157 | $valor = isset($proyecto->{$campo}[$i]) ? $proyecto->{$campo}[$i]['value'] : $valor_d; |
---|
158 | $row[] = array('data' => check_plain($valor), 'align' => 'center',); |
---|
159 | } |
---|
160 | $rows[] = $row; |
---|
161 | } |
---|
162 | if (!count($rows)) { |
---|
163 | $row[] = array('data' => t('No se ha ingresado la sección de Capacidades'), 'colspan' => count($header), 'align' => 'center'); |
---|
164 | $rows[] = $row; |
---|
165 | } |
---|
166 | print theme('table', $header, $rows, array('border' => '1')); |
---|
167 | ?> |
---|
168 | <?php endif ?> |
---|
169 | <h3><?php print t('Instituciones');?></h3> |
---|
170 | <?php print drupal_render($content->content['field_proyecto_relacion']); ?> |
---|
171 | <h3><?php print t('Empleos Generados');?></h3> |
---|
172 | <p><?php print t('Nro Estimados de Empleos:'); ?></p> |
---|
173 | <?php |
---|
174 | $arreglo = array( |
---|
175 | 'field_proyecto_emdirecto' => 'field_proyecto_emdirecto', |
---|
176 | 'field_proyecto_efdirecto' => 'field_proyecto_efdirecto', |
---|
177 | 'field_proyecto_emindirecto' => 'field_proyecto_emindirecto', |
---|
178 | 'field_proyecto_efindirecto' => 'field_proyecto_efindirecto', |
---|
179 | ); |
---|
180 | $header = array(); |
---|
181 | $rows = array(); |
---|
182 | $row = array(); |
---|
183 | $sum_fila = 0; |
---|
184 | foreach($arreglo as $campo) { |
---|
185 | $header[] = array('data' => check_plain($campos_proyectos[$campo]['widget']['label']), 'align' => 'center'); |
---|
186 | $valor_d = 0; |
---|
187 | $valor = isset($proyecto->{$campo}[0]['value']) ? $proyecto->{$campo}[0]['value'] : $valor_d; |
---|
188 | $valor_m = $valor ? number_format($valor, 0, $format_number['dec_point'], $format_number['thousands_sep']) : 0; |
---|
189 | $row[] = array('data' => check_plain($valor_m), 'align' => 'center',); |
---|
190 | $sum_fila += $valor; |
---|
191 | } |
---|
192 | $header[] = array('data' => t('TOTAL'), 'align' => 'center'); |
---|
193 | $valor_m = $sum_fila ? number_format($sum_fila, 0, $format_number['dec_point'], $format_number['thousands_sep']) : 0; |
---|
194 | $row[] = array('data' => $valor_m, 'align' => 'center',); |
---|
195 | $rows[] = $row; |
---|
196 | print theme('table', $header, $rows, array('border' => '1')); |
---|
197 | ?> |
---|
198 | <?php if (variable_get('proyectos_operativos_muestra_beneficiario', TRUE)): ?> |
---|
199 | <h3><?php print t('Beneficiarios');?></h3> |
---|
200 | <?php |
---|
201 | $arreglo = array( |
---|
202 | 'field_proyecto_beneficiario' => 'field_proyecto_beneficiario', |
---|
203 | 'field_proyectos_masculino_d' => 'field_proyectos_masculino_d', |
---|
204 | 'field_proyectos_femenino_d' => 'field_proyectos_femenino_d', |
---|
205 | ); |
---|
206 | if (variable_get('proyectos_operativos_muestra_beneficiarios_indirectos', TRUE)) { |
---|
207 | $arreglo['field_proyectos_masculino_i'] = 'field_proyectos_masculino_i'; |
---|
208 | $arreglo['field_proyectos_femenino_i'] = 'field_proyectos_femenino_i'; |
---|
209 | } |
---|
210 | $header = array(); |
---|
211 | foreach($arreglo as $campo) { |
---|
212 | $header[] = array('data' => check_plain($campos_proyectos[$campo]['widget']['label']), 'align' => 'center'); |
---|
213 | } |
---|
214 | $header[] = array('data' => t('TOTAL'), 'align' => 'center'); |
---|
215 | $tamano_array = array(); |
---|
216 | foreach($arreglo as $field_id => $field) { |
---|
217 | $tamano_array[] = count($proyecto->{$field_id}); |
---|
218 | } |
---|
219 | $cantidad_talento = max($tamano_array); |
---|
220 | $rows = array(); |
---|
221 | $suma_arreglo = array(); |
---|
222 | foreach($arreglo as $campo) { |
---|
223 | $suma_arreglo[$campo] = 0; |
---|
224 | } |
---|
225 | for ($i = 0; $i < $cantidad_talento; $i++) { |
---|
226 | $row = array(); |
---|
227 | $sum_fila = 0; |
---|
228 | foreach($arreglo as $campo) { |
---|
229 | if ($campo != 'field_proyecto_beneficiario') { |
---|
230 | $valor_d = ($field_id == 'field_proyecto_esfuerzo') ? 0 : ''; |
---|
231 | $valor = isset($proyecto->{$campo}[$i]['value']) ? $proyecto->{$campo}[$i]['value'] : $valor_d; |
---|
232 | $valor_m = $valor ? number_format($valor, 0, $format_number['dec_point'], $format_number['thousands_sep']) : 0; |
---|
233 | $row[] = array('data' => check_plain($valor_m), 'align' => 'center',); |
---|
234 | $sum_fila += $valor; |
---|
235 | $suma_arreglo[$campo] += $valor; |
---|
236 | } |
---|
237 | else { |
---|
238 | $row[] = array('data' => check_plain($proyecto->{$campo}[$i]['value']), 'align' => 'center',); |
---|
239 | } |
---|
240 | } |
---|
241 | $valor_m = $sum_fila ? number_format($sum_fila, 0, $format_number['dec_point'], $format_number['thousands_sep']) : 0; |
---|
242 | $row[] = array('data' => $valor_m, 'align' => 'center',); |
---|
243 | $rows[] = $row; |
---|
244 | } |
---|
245 | $sum_fila = 0; |
---|
246 | $row = array(); |
---|
247 | foreach($arreglo as $campo) { |
---|
248 | if ($campo == 'field_proyecto_beneficiario') { |
---|
249 | $row[] = array('data' => t('TOTAL'), 'align' => 'right',); |
---|
250 | } |
---|
251 | else { |
---|
252 | $valor_m = $suma_arreglo[$campo] ? number_format($suma_arreglo[$campo], 0, '', ',') : 0; |
---|
253 | $row[] = array('data' => check_plain($valor_m), 'align' => 'center',); |
---|
254 | $sum_fila += $suma_arreglo[$campo]; |
---|
255 | } |
---|
256 | } |
---|
257 | $valor_m = $sum_fila ? number_format($sum_fila, 0, '', ',') : 0; |
---|
258 | $row[] = array('data' => $valor_m, 'align' => 'center',); |
---|
259 | $rows[] = $row; |
---|
260 | print theme('table', $header, $rows, array('border' => '1')); |
---|
261 | ?> |
---|
262 | <?php endif ?> |
---|
263 | <h3><?php print t('Objetivos del Proyecto');?></h3> |
---|
264 | <?php print drupal_render($content->content['field_proyecto_og']); ?> |
---|
265 | <?php print drupal_render($content->content['field_proyecto_oe']); ?> |
---|
266 | |
---|
267 | |
---|
268 | <h2><?php print t('Indicadores del Proyecto');?></h2> |
---|
269 | <?php print drupal_render($content->content[$campo]); ?> |
---|
270 | |
---|
271 | <?php if (variable_get('proyectos_operativos_muestra_enunciado_problema', TRUE)): ?> |
---|
272 | <h3><?php print t('Enunciado del Problema');?></h3> |
---|
273 | <?php |
---|
274 | $arreglo = array( |
---|
275 | 'field_proyecto_causas' => 'field_proyecto_causas', |
---|
276 | 'field_proyecto_problemas' => 'field_proyecto_problemas', |
---|
277 | 'field_proyecto_consecuencias' => 'field_proyecto_consecuencias', |
---|
278 | ); |
---|
279 | ?> |
---|
280 | <?php foreach($arreglo as $campo): ?> |
---|
281 | <?php print drupal_render($content->content[$campo]); ?> |
---|
282 | <?php endforeach ?> |
---|
283 | <?php endif ?> |
---|
284 | <?php if (variable_get('proyectos_operativos_muestra_justicacion', TRUE)): ?> |
---|
285 | <h3><?php print t('Justificación');?></h3> |
---|
286 | <?php print drupal_render($content->content['field_proyecto_justificacion']); ?> |
---|
287 | <?php endif ?> |
---|
288 | <?php if (variable_get('proyectos_operativos_muestra_alcance', TRUE)): ?> |
---|
289 | <h3><?php print t('Alcance del Proyecto');?></h3> |
---|
290 | <?php print drupal_render($content->content['field_proyecto_alcance']); ?> |
---|
291 | <?php endif ?> |
---|
292 | <?php |
---|
293 | $sa = variable_get('proyectos_operativos_muestra_sa', TRUE); |
---|
294 | $so = variable_get('proyectos_operativos_muestra_so', TRUE); |
---|
295 | ?> |
---|
296 | <?php if ($sa || $so): ?> |
---|
297 | <h3><?php print t('Indicador de la Situación');?></h3> |
---|
298 | <?php if ($sa): ?> |
---|
299 | <h4><?php print t('Situación Actual');?></h4> |
---|
300 | <?php |
---|
301 | $arreglo = array( |
---|
302 | 'field_proyecto_sa_descripcion' => 'field_proyecto_sa_descripcion', |
---|
303 | ); |
---|
304 | if (variable_get('proyectos_operativos_muestra_sa_cuantificacion', TRUE)) { |
---|
305 | $arreglo['field_proyecto_sa_cuantificacion'] = 'field_proyecto_sa_cuantificacion'; |
---|
306 | } |
---|
307 | $arreglo['field_proyecto_sa_formulai'] = 'field_proyecto_sa_formulai'; |
---|
308 | $arreglo['field_proyecto_sa_fuentei'] = 'field_proyecto_sa_fuentei'; |
---|
309 | $arreglo['field_proyecto_sa_fecha'] = 'field_proyecto_sa_fecha'; |
---|
310 | ?> |
---|
311 | <?php foreach($arreglo as $campo): ?> |
---|
312 | <?php print drupal_render($content->content[$campo]); ?> |
---|
313 | <?php endforeach ?> |
---|
314 | <?php endif ?> |
---|
315 | <?php if ($so): ?> |
---|
316 | <h4><?php print t('Situación Objetivo');?></h4> |
---|
317 | <?php |
---|
318 | $arreglo = array( |
---|
319 | 'field_proyecto_so_descripcion' => 'field_proyecto_so_descripcion', |
---|
320 | 'field_proyecto_so_cuantificacion' => 'field_proyecto_so_cuantificacion', |
---|
321 | 'field_proyecto_tiempoi' => 'field_proyecto_tiempoi', |
---|
322 | ); |
---|
323 | ?> |
---|
324 | <?php foreach($arreglo as $campo): ?> |
---|
325 | <?php print drupal_render($content->content[$campo]); ?> |
---|
326 | <?php endforeach ?> |
---|
327 | <?php endif ?> |
---|
328 | <?php endif ?> |
---|
329 | <h3><?php print t('Indicador del resultado del Proyecto');?></h3> |
---|
330 | <?php |
---|
331 | $arreglo = array( |
---|
332 | 'field_proyecto_descripcion_bien' => 'field_proyecto_descripcion_bien', |
---|
333 | 'field_proyecto_unidadm' => 'field_proyecto_unidadm', |
---|
334 | 'field_proyecto_meta_fisica' => 'field_proyecto_meta_fisica', |
---|
335 | ); |
---|
336 | if (module_exists('proyectos_reformulacion')) { |
---|
337 | $arreglo['field_proyecto_unidadm'] = 'proyectos_operativos_unidad_medida_reformulado'; |
---|
338 | $arreglo['field_proyecto_meta_fisica'] = 'proyectos_operativos_meta_fisica_reformulado'; |
---|
339 | } |
---|
340 | ?> |
---|
341 | <?php foreach($arreglo as $campo): ?> |
---|
342 | <?php print drupal_render($content->content[$campo]); ?> |
---|
343 | <?php endforeach ?> |
---|
344 | <h3><?php print t('Acciones EspecÃficas');?></h3> |
---|
345 | <?php print drupal_render($content->content['field_proyecto_accion_esp']); ?> |
---|