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_descripcin_proyect' => 'field_descripcin_proyect', |
---|
49 | 'field_proyecto_fecha_i' => 'field_proyecto_fecha_i', |
---|
50 | 'field_proyecto_fecha_f' => 'field_proyecto_fecha_f', |
---|
51 | 'field_proyecto_status' => 'field_proyecto_status', |
---|
52 | 'field_proyecto_situacion_p' => 'field_proyecto_situacion_p', |
---|
53 | 'field_proyecto_plurianual' => 'field_proyecto_plurianual', |
---|
54 | 'field_proyecto_monto_anual' => 'field_proyecto_monto_anual', |
---|
55 | 'field_proyecto_total' => 'field_proyecto_total', |
---|
56 | 'field_proyecto_poan' => 'field_proyecto_poan', |
---|
57 | ); |
---|
58 | if (module_exists('proyectos_reformulacion')) { |
---|
59 | $arreglo['field_proyecto_monto_anual'] = 'proyectos_operativos_monto_anual_reformulado'; |
---|
60 | $arreglo['field_proyecto_total'] = 'proyectos_operativos_monto_total_reformulado'; |
---|
61 | } |
---|
62 | ?> |
---|
63 | <?php foreach($arreglo as $campo): ?> |
---|
64 | <?php print drupal_render($content->content[$campo]); ?> |
---|
65 | <?php endforeach ?> |
---|
66 | <fieldset><legend><h3><?php print t('Responsables del proyecto');?></h3></legend> |
---|
67 | <?php print drupal_render($content->content['field_proyecto_ente']); ?> |
---|
68 | <?php |
---|
69 | $arreglo = array( |
---|
70 | 'field_proyecto_autoridad' => 'field_proyecto_autoridad', |
---|
71 | 'field_proyecto_lider' => 'field_proyecto_lider', |
---|
72 | 'field_proyecto_unidad_a' => 'field_proyecto_unidad_a', |
---|
73 | 'field_proyecto_cargo' => 'field_proyecto_cargo', |
---|
74 | 'field_proyecto_telefono' => 'field_proyecto_telefono', |
---|
75 | 'field_proyecto_correo' => 'field_proyecto_correo', |
---|
76 | ); |
---|
77 | ?> |
---|
78 | <?php foreach($arreglo as $campo): ?> |
---|
79 | <?php print drupal_render($content->content[$campo]); ?> |
---|
80 | <?php endforeach ?> |
---|
81 | |
---|
82 | <?php if (variable_get('proyectos_operativos_muestra_responsables', TRUE)): ?> |
---|
83 | <?php |
---|
84 | $arreglo['gerente'] = array( |
---|
85 | 'field_proyecto_nombre_gere' => 'field_proyecto_nombre_gere', |
---|
86 | 'field_proyecto_cedul_gere' => 'field_proyecto_cedul_gere', |
---|
87 | 'field_proyecto_corre_gere' => 'field_proyecto_corre_gere', |
---|
88 | 'field_proyecto_telef_gere' => 'field_proyecto_telef_gere', |
---|
89 | ); |
---|
90 | $arreglo['tecnico'] = array( |
---|
91 | 'field_proyecto_nom_r_tec' => 'field_proyecto_nom_r_tec', |
---|
92 | 'field_proyecto_ced_r_tec' => 'field_proyecto_ced_r_tec', |
---|
93 | 'field_proyecto_cor_r_tec' => 'field_proyecto_cor_r_tec', |
---|
94 | 'field_proyecto_tel_r_tec' => 'field_proyecto_tel_r_tec', |
---|
95 | 'field_proyecto_und_r_tec' => 'field_proyecto_und_r_tec', |
---|
96 | ); |
---|
97 | $arreglo['registrador'] = array( |
---|
98 | 'field_proyecto_nom_r_reg' => 'field_proyecto_nom_r_reg', |
---|
99 | 'field_proyecto_ced_r_reg' => 'field_proyecto_ced_r_reg', |
---|
100 | 'field_proyecto_cor_r_reg' => 'field_proyecto_cor_r_reg', |
---|
101 | 'field_proyecto_tel_r_reg' => 'field_proyecto_tel_r_reg', |
---|
102 | ); |
---|
103 | $arreglo['administrativo'] = array( |
---|
104 | 'field_proyecto_nom_r_adm' => 'field_proyecto_nom_r_adm', |
---|
105 | 'field_proyecto_ced_r_adm' => 'field_proyecto_ced_r_adm', |
---|
106 | 'field_proyecto_cor_r_adm' => 'field_proyecto_cor_r_adm', |
---|
107 | 'field_proyecto_tel_r_adm' => 'field_proyecto_tel_r_adm', |
---|
108 | 'field_proyecto_und_r_adm' => 'field_proyecto_und_r_adm', |
---|
109 | ); |
---|
110 | ?> |
---|
111 | <!-- Responsable Gerente --> |
---|
112 | <?php print ("<h3>Datos del Gerente</h3>"); ?> |
---|
113 | <?php print("<table>"); ?> |
---|
114 | <?php foreach($arreglo['gerente'] as $campo): ?> |
---|
115 | <?php print("<th>"); ?> |
---|
116 | <?php print $content->content[$campo]['field']['#title']; ?> |
---|
117 | <?php print("</th>"); ?> |
---|
118 | <?php endforeach ?> |
---|
119 | <?php print("<tr class='odd'>"); ?> |
---|
120 | <?php foreach($arreglo['gerente'] as $campo): ?> |
---|
121 | <?php print("<td>"); ?> |
---|
122 | <?php foreach($content->content[$campo]['field']['#node']->$campo as $id => $value): ?> |
---|
123 | <?php if (isset($value['email'])): ?> |
---|
124 | <?php $values = $value['email']; ?> |
---|
125 | <?php else: ?> |
---|
126 | <?php $values = $value['value']; ?> |
---|
127 | <?php endif; ?> |
---|
128 | <?php endforeach ?> |
---|
129 | <?php print $values; ?> |
---|
130 | <?php print("</td>"); ?> |
---|
131 | <?php endforeach ?> |
---|
132 | <?php print("<tr>"); ?> |
---|
133 | <?php print("</table>"); ?> |
---|
134 | <!-- end Responsable Gerente --> |
---|
135 | |
---|
136 | <!-- Responsable tecnico --> |
---|
137 | <?php print ("<h3>Datos del Responsable tecnico</h3>"); ?> |
---|
138 | <?php print("<table>"); ?> |
---|
139 | <?php foreach($arreglo['tecnico'] as $campo): ?> |
---|
140 | <?php print("<th>"); ?> |
---|
141 | <?php print $content->content[$campo]['field']['#title']; ?> |
---|
142 | <?php print("</th>"); ?> |
---|
143 | <?php endforeach ?> |
---|
144 | <?php print("<tr class='odd'>"); ?> |
---|
145 | <?php foreach($arreglo['tecnico'] as $campo): ?> |
---|
146 | <?php print("<td>"); ?> |
---|
147 | <?php foreach($content->content[$campo]['field']['#node']->$campo as $id => $value): ?> |
---|
148 | <?php if (isset($value['email'])): ?> |
---|
149 | <?php $values = $value['email']; ?> |
---|
150 | <?php else: ?> |
---|
151 | <?php $values = $value['value']; ?> |
---|
152 | <?php endif; ?> |
---|
153 | <?php endforeach ?> |
---|
154 | <?php print $values; ?> |
---|
155 | <?php print("</td>"); ?> |
---|
156 | <?php endforeach ?> |
---|
157 | <?php print("<tr>"); ?> |
---|
158 | <?php print("</table>"); ?> |
---|
159 | <!-- end Responsable tecnico --> |
---|
160 | |
---|
161 | <!-- Responsable registrador --> |
---|
162 | <?php print ("<h3>Datos del Responsable Registrador</h3>"); ?> |
---|
163 | <?php print("<table>"); ?> |
---|
164 | <?php foreach($arreglo['registrador'] as $campo): ?> |
---|
165 | <?php print("<th>"); ?> |
---|
166 | <?php print $content->content[$campo]['field']['#title']; ?> |
---|
167 | <?php print("</th>"); ?> |
---|
168 | <?php endforeach ?> |
---|
169 | <?php print("<tr class='odd'>"); ?> |
---|
170 | <?php foreach($arreglo['registrador'] as $campo): ?> |
---|
171 | <?php print("<td>"); ?> |
---|
172 | <?php foreach($content->content[$campo]['field']['#node']->$campo as $id => $value): ?> |
---|
173 | <?php if (isset($value['email'])): ?> |
---|
174 | <?php $values = $value['email']; ?> |
---|
175 | <?php else: ?> |
---|
176 | <?php $values = $value['value']; ?> |
---|
177 | <?php endif; ?> |
---|
178 | <?php endforeach ?> |
---|
179 | <?php print $values; ?> |
---|
180 | <?php print("</td>"); ?> |
---|
181 | <?php endforeach ?> |
---|
182 | <?php print("<tr>"); ?> |
---|
183 | <?php print("</table>"); ?> |
---|
184 | <!-- end Responsable registrador --> |
---|
185 | |
---|
186 | <!-- Responsable administrador --> |
---|
187 | <?php print ("<h3>Datos del Responsable Administrativo</h3>"); ?> |
---|
188 | <?php print("<table>"); ?> |
---|
189 | <?php foreach($arreglo['administrativo'] as $campo): ?> |
---|
190 | <?php print("<th>"); ?> |
---|
191 | <?php print $content->content[$campo]['field']['#title']; ?> |
---|
192 | <?php print("</th>"); ?> |
---|
193 | <?php endforeach ?> |
---|
194 | <?php print("<tr class='odd'>"); ?> |
---|
195 | <?php foreach($arreglo['administrativo'] as $campo): ?> |
---|
196 | <?php print("<td>"); ?> |
---|
197 | <?php foreach($content->content[$campo]['field']['#node']->$campo as $id => $value): ?> |
---|
198 | <?php if (isset($value['email'])): ?> |
---|
199 | <?php $values = $value['email']; ?> |
---|
200 | <?php else: ?> |
---|
201 | <?php $values = $value['value']; ?> |
---|
202 | <?php endif; ?> |
---|
203 | <?php endforeach ?> |
---|
204 | <?php print $values; ?> |
---|
205 | <?php print("</td>"); ?> |
---|
206 | <?php endforeach ?> |
---|
207 | <?php print("<tr>"); ?> |
---|
208 | <?php print("</table>"); ?> |
---|
209 | <!-- end Responsable administrador --> |
---|
210 | </fieldset> |
---|
211 | <?php endif ?> |
---|
212 | |
---|
213 | <?php |
---|
214 | $pndes = variable_get('proyectos_operativos_muestra_pndes', TRUE); |
---|
215 | $mcti = variable_get('proyectos_operativos_muestra_mcti', TRUE); |
---|
216 | if ($pndes || $mcti) { |
---|
217 | print '<h3>' . t('Ãrea Estrategica') . '</h3>'; |
---|
218 | if ($pndes) { |
---|
219 | print drupal_render($content->content['field_proyecto_pndes']); |
---|
220 | } |
---|
221 | if ($mcti) { |
---|
222 | print drupal_render($content->content['field_proyecto_mcti']); |
---|
223 | } |
---|
224 | } |
---|
225 | ?> |
---|
226 | <h2><?php print t('Datos Generales');?></h2> |
---|
227 | <h3><?php print t('Clasificación Sectorial');?></h3> |
---|
228 | <?php print drupal_render($content->content['field_proyecto_sector']); ?> |
---|
229 | <?php if(variable_get('proyectos_operativos_muestra_talento', TRUE)) : ?> |
---|
230 | <h2><?php print t('Talento Humano');?></h2> |
---|
231 | <?php |
---|
232 | $arreglo = array( |
---|
233 | 'field_proyecto_institucionth' => 'field_proyecto_institucionth', |
---|
234 | 'field_proyecto_nombres_a' => 'field_proyecto_nombres_a', |
---|
235 | 'field_proyecto_cargo_th' => 'field_proyecto_cargo_th', |
---|
236 | 'field_proyecto_rol_th' => 'field_proyecto_rol_th', |
---|
237 | 'field_proyecto_esfuerzo' => 'field_proyecto_esfuerzo', |
---|
238 | 'field_proyecto_formacion' => 'field_proyecto_formacion', |
---|
239 | ); |
---|
240 | $header = array(); |
---|
241 | foreach($arreglo as $campo) { |
---|
242 | $header[] = array('data' => check_plain($campos_proyectos[$campo]['widget']['label']), 'align' => 'center'); |
---|
243 | } |
---|
244 | $tamano_array = array(); |
---|
245 | foreach($arreglo as $field_id => $field) { |
---|
246 | $tamano_array[] = count($proyecto->{$field_id}); |
---|
247 | } |
---|
248 | $cantidad_talento = max($tamano_array); |
---|
249 | $rows = array(); |
---|
250 | for ($i = 0; $i < $cantidad_talento; $i++) { |
---|
251 | $row = array(); |
---|
252 | foreach($arreglo as $campo) { |
---|
253 | $valor_d = ($campo == 'field_proyecto_esfuerzo') ? 0 : ''; |
---|
254 | $valor = isset($proyecto->{$campo}[$i]) ? $proyecto->{$field_id}[$i]['value'] : $valor_d; |
---|
255 | $row[] = array('data' => check_plain($valor), 'align' => 'center',); |
---|
256 | } |
---|
257 | $rows[] = $row; |
---|
258 | } |
---|
259 | if (!count($rows)) { |
---|
260 | $row[] = array('data' => t('No se ha ingresado la sección de Talento Humano'), 'colspan' => count($header), 'align' => 'center'); |
---|
261 | $rows[] = $row; |
---|
262 | } |
---|
263 | print theme('table', $header, $rows, array('border' => '1')); |
---|
264 | ?> |
---|
265 | <?php endif; ?> |
---|
266 | <?php if (variable_get('proyectos_operativos_muestra_capacidades', TRUE)): ?> |
---|
267 | <h3><?php print t('Capacidades');?></h3> |
---|
268 | <?php |
---|
269 | $arreglo = array( |
---|
270 | 'field_proyecto_institucion_alc' => 'field_proyecto_institucion_alc', |
---|
271 | 'field_proyecto_infraestructura' => 'field_proyecto_infraestructura', |
---|
272 | 'field_proyecto_equipos' => 'field_proyecto_equipos', |
---|
273 | 'field_proyecto_insumos' => 'field_proyecto_insumos', |
---|
274 | 'field_proyectos_servicios' => 'field_proyectos_servicios', |
---|
275 | ); |
---|
276 | $header = array(); |
---|
277 | foreach($arreglo as $campo) { |
---|
278 | $header[] = array('data' => check_plain($campos_proyectos[$campo]['widget']['label']), 'align' => 'center'); |
---|
279 | } |
---|
280 | $tamano_array = array(); |
---|
281 | foreach($arreglo as $field_id => $field) { |
---|
282 | $tamano_array[] = count($proyecto->{$field_id}); |
---|
283 | } |
---|
284 | $cantidad_talento = max($tamano_array); |
---|
285 | $rows = array(); |
---|
286 | for ($i = 0; $i < $cantidad_talento; $i++) { |
---|
287 | $row = array(); |
---|
288 | foreach($arreglo as $campo) { |
---|
289 | $valor_d = ($campo == 'field_proyecto_esfuerzo') ? 0 : ''; |
---|
290 | $valor = isset($proyecto->{$campo}[$i]) ? $proyecto->{$campo}[$i]['value'] : $valor_d; |
---|
291 | $row[] = array('data' => check_plain($valor), 'align' => 'center',); |
---|
292 | } |
---|
293 | $rows[] = $row; |
---|
294 | } |
---|
295 | if (!count($rows)) { |
---|
296 | $row[] = array('data' => t('No se ha ingresado la sección de Capacidades'), 'colspan' => count($header), 'align' => 'center'); |
---|
297 | $rows[] = $row; |
---|
298 | } |
---|
299 | print theme('table', $header, $rows, array('border' => '1')); |
---|
300 | ?> |
---|
301 | <?php endif ?> |
---|
302 | <h3><?php print t('Instituciones');?></h3> |
---|
303 | <?php print drupal_render($content->content['field_proyecto_relacion']); ?> |
---|
304 | <h3><?php print t('Nro Estimados de Empleos Generados');?></h3> |
---|
305 | <?php |
---|
306 | $labels = array( |
---|
307 | 'field_proyectos_femenino_i' => t('Empleos Femeninos'), |
---|
308 | 'field_proyectos_femenino_d'=> t('Empleos Masculinos'), |
---|
309 | 'field_proyectos_masculino_d' => t('Total'), |
---|
310 | ); |
---|
311 | $arreglo1 = array( |
---|
312 | 'field_proyecto_efdirecto' => 'field_proyecto_efdirecto', |
---|
313 | 'field_proyecto_emdirecto' => 'field_proyecto_emdirecto', |
---|
314 | ); |
---|
315 | $arreglo2 = array( |
---|
316 | 'field_proyecto_emindirecto' => 'field_proyecto_emindirecto', |
---|
317 | 'field_proyecto_efindirecto' => 'field_proyecto_efindirecto', |
---|
318 | ); |
---|
319 | $header = array(); |
---|
320 | $rows = array(); |
---|
321 | $row = array(); |
---|
322 | $sum_fila = 0; |
---|
323 | foreach ($labels as $label) { |
---|
324 | $header[] = array('data' => $label, 'align' => 'center'); |
---|
325 | } |
---|
326 | foreach($arreglo1 as $campo) { |
---|
327 | $valor_d = 0; |
---|
328 | $valor = isset($proyecto->{$campo}[0]['value']) ? $proyecto->{$campo}[0]['value'] : $valor_d; |
---|
329 | $valor_m = $valor ? number_format($valor, 0, $format_number['dec_point'], $format_number['thousands_sep']) : 0; |
---|
330 | $row[] = array('data' => t('Directos Nuevos: ') . check_plain($valor_m), 'align' => 'left',); |
---|
331 | $sum_fila += $valor; |
---|
332 | } |
---|
333 | $valor_m = $sum_fila ? number_format($sum_fila, 0, $format_number['dec_point'], $format_number['thousands_sep']) : 0; |
---|
334 | $row[] = array('data' => t('Empleos Nuevos: ') . $valor_m, 'align' => 'left',); |
---|
335 | $rows[] = $row; |
---|
336 | $row = array(); |
---|
337 | $sum_fila = 0; |
---|
338 | foreach($arreglo2 as $campo) { |
---|
339 | $valor_d = 0; |
---|
340 | $valor = isset($proyecto->{$campo}[0]['value']) ? $proyecto->{$campo}[0]['value'] : $valor_d; |
---|
341 | $valor_m = $valor ? number_format($valor, 0, $format_number['dec_point'], $format_number['thousands_sep']) : 0; |
---|
342 | $row[] = array('data' => t('Directos Sostenidos: ') . check_plain($valor_m), 'align' => 'left',); |
---|
343 | $sum_fila += $valor; |
---|
344 | } |
---|
345 | $valor_m = $sum_fila ? number_format($sum_fila, 0, $format_number['dec_point'], $format_number['thousands_sep']) : 0; |
---|
346 | $row[] = array('data' => t('Empleos Sostenidos: ') . $valor_m, 'align' => 'left',); |
---|
347 | |
---|
348 | $rows[] = $row; |
---|
349 | |
---|
350 | $row = array(); |
---|
351 | $valor_t1 = $proyecto->field_proyecto_efdirecto[0]['value'] + $proyecto->field_proyecto_emindirecto[0]['value']; |
---|
352 | $row[] = array('data' => t('Total de Empleos Directos Femeninos: ') . number_format($valor_t1, 0, $format_number['dec_point'], $format_number['thousands_sep']), 'align' => 'left',); |
---|
353 | |
---|
354 | $valor_t2 = $proyecto->field_proyecto_emdirecto[0]['value'] + $proyecto->field_proyecto_efindirecto[0]['value']; |
---|
355 | $row[] = array('data' => t('Total de Empleos Directos Masculinos: ') . number_format($valor_t2, 0, $format_number['dec_point'], $format_number['thousands_sep']), 'align' => 'left',); |
---|
356 | |
---|
357 | $valor_t = $valor_t1 + $valor_t2; |
---|
358 | $row[]= array('data' => t('Total de Empleos Directos: ') . number_format($valor_t, 0, $format_number['dec_point'], $format_number['thousands_sep']), 'align' => 'left',); |
---|
359 | |
---|
360 | $rows[] = $row; |
---|
361 | print '<fieldset><legend>Nro Estimados de Empleos</legend>' . theme('table', $header, $rows, array('border' => '1')) . '</fieldset>'; |
---|
362 | ?> |
---|
363 | <?php if (variable_get('proyectos_operativos_muestra_beneficiario', TRUE)): ?> |
---|
364 | <h3><?php print t('Beneficiarios');?></h3> |
---|
365 | <?php |
---|
366 | $labes = array( |
---|
367 | 'field_proyecto_beneficiario' => t('Beneficiario'), |
---|
368 | 'field_proyectos_masculino_d' => t('Número estimado de beneficiarios masculinos'), |
---|
369 | 'field_proyectos_femenino_i' => t('Número estimado de beneficiarios femeninos'), |
---|
370 | ); |
---|
371 | $arreglo = array( |
---|
372 | 'field_proyecto_beneficiario' => 'field_proyecto_beneficiario', |
---|
373 | 'field_proyectos_masculino_d' => 'field_proyectos_masculino_d', |
---|
374 | //'field_proyectos_femenino_d' => 'field_proyectos_femenino_d', |
---|
375 | ); |
---|
376 | if (variable_get('proyectos_operativos_muestra_beneficiarios_indirectos', TRUE)) { |
---|
377 | // $arreglo['field_proyectos_masculino_i'] = 'field_proyectos_masculino_i'; |
---|
378 | $arreglo['field_proyectos_femenino_i'] = 'field_proyectos_femenino_i'; |
---|
379 | } |
---|
380 | $header = array(); |
---|
381 | foreach($labes as $label) { |
---|
382 | $header[] = array('data' => $label, 'align' => 'center'); |
---|
383 | } |
---|
384 | $header[] = array('data' => t('TOTAL'), 'align' => 'center'); |
---|
385 | $tamano_array = array(); |
---|
386 | foreach($arreglo as $field_id => $field) { |
---|
387 | $tamano_array[] = count($proyecto->{$field_id}); |
---|
388 | } |
---|
389 | $cantidad_talento = max($tamano_array); |
---|
390 | $rows = array(); |
---|
391 | $suma_arreglo = array(); |
---|
392 | foreach($arreglo as $campo) { |
---|
393 | $suma_arreglo[$campo] = 0; |
---|
394 | } |
---|
395 | for ($i = 0; $i < $cantidad_talento; $i++) { |
---|
396 | $row = array(); |
---|
397 | $sum_fila = 0; |
---|
398 | foreach($arreglo as $campo) { |
---|
399 | if ($campo != 'field_proyecto_beneficiario') { |
---|
400 | $valor_d = ($field_id == 'field_proyecto_esfuerzo') ? 0 : ''; |
---|
401 | $valor = isset($proyecto->{$campo}[$i]['value']) ? $proyecto->{$campo}[$i]['value'] : $valor_d; |
---|
402 | $valor_m = $valor ? number_format($valor, 0, $format_number['dec_point'], $format_number['thousands_sep']) : 0; |
---|
403 | $row[] = array('data' => check_plain($valor_m), 'align' => 'center',); |
---|
404 | $sum_fila += $valor; |
---|
405 | $suma_arreglo[$campo] += $valor; |
---|
406 | } |
---|
407 | else { |
---|
408 | $row[] = array('data' => check_plain($proyecto->{$campo}[$i]['value']), 'align' => 'left',); |
---|
409 | } |
---|
410 | } |
---|
411 | $valor_m = $sum_fila ? number_format($sum_fila, 0, $format_number['dec_point'], $format_number['thousands_sep']) : 0; |
---|
412 | $row[] = array('data' => $valor_m, 'align' => 'center',); |
---|
413 | $rows[] = $row; |
---|
414 | } |
---|
415 | $sum_fila = 0; |
---|
416 | $row = array(); |
---|
417 | foreach($arreglo as $campo) { |
---|
418 | if ($campo == 'field_proyecto_beneficiario') { |
---|
419 | $row[] = array('data' => t('TOTAL DE BENEFICIARIOS'), 'align' => 'right',); |
---|
420 | } |
---|
421 | else { |
---|
422 | $valor_m = $suma_arreglo[$campo] ? number_format($suma_arreglo[$campo], 0, $format_number['dec_point'], $format_number['thousands_sep']) : 0; |
---|
423 | $row[] = array('data' => check_plain($valor_m), 'align' => 'center',); |
---|
424 | $sum_fila += $suma_arreglo[$campo]; |
---|
425 | } |
---|
426 | } |
---|
427 | $valor_m = $sum_fila ? number_format($sum_fila, 0, $format_number['dec_point'], $format_number['thousands_sep']) : 0; |
---|
428 | $row[] = array('data' => $valor_m, 'align' => 'center',); |
---|
429 | $rows[] = $row; |
---|
430 | print theme('table', $header, $rows, array('border' => '1')); |
---|
431 | ?> |
---|
432 | <?php endif ?> |
---|
433 | <h3><?php print t('Objetivos del Proyecto');?></h3> |
---|
434 | <?php print drupal_render($content->content['field_proyecto_og']); ?> |
---|
435 | <?php print drupal_render($content->content['field_proyecto_oe']); ?> |
---|
436 | |
---|
437 | |
---|
438 | <h2><?php print t('Indicadores del Proyecto');?></h2> |
---|
439 | <?php print drupal_render($content->content[$campo]); ?> |
---|
440 | |
---|
441 | <?php if (variable_get('proyectos_operativos_muestra_enunciado_problema', TRUE)): ?> |
---|
442 | <h3><?php print t('Enunciado del Problema');?></h3> |
---|
443 | <?php |
---|
444 | $arreglo = array( |
---|
445 | 'field_proyecto_causas' => 'field_proyecto_causas', |
---|
446 | 'field_proyecto_problemas' => 'field_proyecto_problemas', |
---|
447 | 'field_proyecto_consecuencias' => 'field_proyecto_consecuencias', |
---|
448 | ); |
---|
449 | ?> |
---|
450 | <?php foreach($arreglo as $campo): ?> |
---|
451 | <?php print drupal_render($content->content[$campo]); ?> |
---|
452 | <?php endforeach ?> |
---|
453 | <?php endif ?> |
---|
454 | <?php if (variable_get('proyectos_operativos_muestra_justicacion', TRUE)): ?> |
---|
455 | <h3><?php print t('Justificación');?></h3> |
---|
456 | <?php print drupal_render($content->content['field_proyecto_justificacion']); ?> |
---|
457 | <?php endif ?> |
---|
458 | <?php if (variable_get('proyectos_operativos_muestra_alcance', TRUE)): ?> |
---|
459 | <h3><?php print t('Alcance del Proyecto');?></h3> |
---|
460 | <?php print drupal_render($content->content['field_proyecto_alcance']); ?> |
---|
461 | <?php endif ?> |
---|
462 | <?php if (variable_get('proyectos_operativos_muestra_servicios_balance', TRUE)): ?> |
---|
463 | <fieldset><legend><h3><?php print t('Impacto Ambiental del Proyecto');?></h3></legend> |
---|
464 | <h4><?php print t('Tipo de impacto');?></h4> |
---|
465 | <?php print drupal_render($content->content['field_tipo_factores']); ?> |
---|
466 | <?php print drupal_render($content->content['field_factor_impact_multifc']); ?> |
---|
467 | <?php print drupal_render($content->content['field_factor_segun_origen']); ?> |
---|
468 | <?php print drupal_render($content->content['field_factor_impact_multiog']); ?> |
---|
469 | <hr> |
---|
470 | <h4><?php print t('Caracterización cualitativa de los efectos');?></h4> |
---|
471 | <?php |
---|
472 | $arreglo = array(); |
---|
473 | $arreglo[] = array( |
---|
474 | 'field_factor_naturaleza' => 'Naturaleza', |
---|
475 | 'field_factor_intensidad' => 'Intensidad', |
---|
476 | 'field_factor_momento' => 'Momento', |
---|
477 | 'field_factor_persistencia' => 'Persistencia', |
---|
478 | 'field_factor_reversibilidad' => 'Reversibilidad', |
---|
479 | ); |
---|
480 | $arreglo[] = array( |
---|
481 | 'field_factor_extension' => 'Extensión', |
---|
482 | 'field_factor_sinergismo' => ' Sinergismo', |
---|
483 | 'field_factor_acumulacion' => 'Acumulación', |
---|
484 | 'field_factor_relacion' =>' Relación causa-efecto', |
---|
485 | 'field_factor_recuperabilidad' => ' Recuperabilidad', |
---|
486 | ); |
---|
487 | $arreglo[] = array( |
---|
488 | 'field_factor_importancia' => 'Importancia', |
---|
489 | 'field_factor_medids_impact' => '¿Cuales serán las medidas para mitigar o eliminar los impactos ambientales de este proyecto?', |
---|
490 | ); |
---|
491 | |
---|
492 | foreach ($arreglo as $values) { |
---|
493 | $row = array(); $rows = array(); |
---|
494 | $header = array(); |
---|
495 | foreach ($values as $key => $value) { |
---|
496 | $field = content_fields($key); |
---|
497 | $header[] = array('data' => $value, 'align' => 'center'); |
---|
498 | $value = check_plain($proyecto->{$field['field_name']}[0]['value']); |
---|
499 | if ($options = optionwidgets_options($field)) { |
---|
500 | $value = $options[$proyecto->{$field['field_name']}[0]['value']]; |
---|
501 | } |
---|
502 | $row[] = array('data' => $value, 'align' => 'left',); |
---|
503 | } |
---|
504 | $rows[] = $row; |
---|
505 | print theme('table', $header, $rows, array('border' => '1')); |
---|
506 | } |
---|
507 | ?> |
---|
508 | </fieldset> |
---|
509 | <?php endif ?> |
---|
510 | <?php if (variable_get('proyectos_operativos_muestra_servicios_balance', TRUE)): ?> |
---|
511 | <fieldset><legend><h3><?php print t('Balance Estimado Nacional de Servicios Energéticos');?></h3></legend> |
---|
512 | <?php |
---|
513 | $arreglo = array(); |
---|
514 | $rows = array(); |
---|
515 | $arreglo['servicios'] = array( |
---|
516 | 'field_balnc_progrmn_anu' => 'Tipo de Instalación', |
---|
517 | 'field_balance_fuente' => 'Fuente', |
---|
518 | 'field_balanc_tipofuent' => 'Tipo de Fuente', |
---|
519 | 'field_balanc_tipoprod' => 'Tipo de Producto', |
---|
520 | 'field_balanc_unidmed' => 'Unidad de Medida', |
---|
521 | 'field_balanc_capacid' => 'Capacidad', |
---|
522 | 'field_balanc_anho' => 'Año', |
---|
523 | ); |
---|
524 | $header = ''; |
---|
525 | $element = array(); |
---|
526 | foreach ($arreglo['servicios'] as $field_id => $label) { |
---|
527 | if (isset($proyecto->{$field_id})) { |
---|
528 | foreach ($proyecto->{$field_id} as $key => $field) { |
---|
529 | $field = content_fields($field_id); |
---|
530 | $value = check_plain($proyecto->{$field_id}[$key]['value']); |
---|
531 | if ($options = optionwidgets_options($field)) { |
---|
532 | $value = $options[$proyecto->{$field_id}[$key]['value']]; |
---|
533 | } |
---|
534 | $element[$key] .= '<td>' . $value . '</td>'; |
---|
535 | } |
---|
536 | $header .= '<th>' . $label . '</th>'; |
---|
537 | } |
---|
538 | } |
---|
539 | if (count($element)) { |
---|
540 | $output = '<table>'; |
---|
541 | $output .= '<tr>'. $header . '</tr>'; |
---|
542 | foreach ($element as $value) { |
---|
543 | $output .= '<tr class="odd">'; |
---|
544 | $output .= $value; |
---|
545 | $output .= '</tr>'; |
---|
546 | } |
---|
547 | $output .= '</table>'; |
---|
548 | print $output; |
---|
549 | } |
---|
550 | ?> |
---|
551 | </fieldset> |
---|
552 | <?php endif ?> |
---|
553 | |
---|
554 | <?php if (variable_get('proyectos_operativos_muestra_programacion_anual', TRUE)): ?> |
---|
555 | <fieldset><legend><h3><?php print t('Programacion Anual por Consumidor');?></h3></legend> |
---|
556 | <?php |
---|
557 | $arreglo = array(); |
---|
558 | $rows = array(); |
---|
559 | $arreglo['programacion'] = array( |
---|
560 | 'field_progrmcn_anual_prog' => 'Tipo de Instalación', |
---|
561 | 'field_progrmcn_anual_unid' => 'Unidad de Medida', |
---|
562 | 'field_progrmcn_anual_cap' => 'Capacidad', |
---|
563 | 'field_progrmcn_anual_anho' => 'Año', |
---|
564 | ); |
---|
565 | |
---|
566 | $header = ''; |
---|
567 | $element = array(); |
---|
568 | foreach ($arreglo['programacion'] as $field_id => $label) { |
---|
569 | if (isset($proyecto->{$field_id})) { |
---|
570 | foreach ($proyecto->{$field_id} as $key => $field) { |
---|
571 | $field = content_fields($field_id); |
---|
572 | $value = check_plain($proyecto->{$field_id}[$key]['value']); |
---|
573 | if ($options = optionwidgets_options($field)) { |
---|
574 | $value = $options[$proyecto->{$field_id}[$key]['value']]; |
---|
575 | } |
---|
576 | $element[$key] .= '<td>' . $value . '</td>'; |
---|
577 | } |
---|
578 | $header .= '<th>' . $label . '</th>'; |
---|
579 | } |
---|
580 | } |
---|
581 | if (count($element)) { |
---|
582 | $output = '<table>'; |
---|
583 | $output .= '<tr>'. $header . '</tr>'; |
---|
584 | foreach ($element as $value) { |
---|
585 | $output .= '<tr class="odd">'; |
---|
586 | $output .= $value; |
---|
587 | $output .= '</tr>'; |
---|
588 | } |
---|
589 | $output .= '</table>'; |
---|
590 | print $output; |
---|
591 | } |
---|
592 | ?> |
---|
593 | </fieldset> |
---|
594 | <?php endif ?> |
---|
595 | <?php |
---|
596 | $sa = variable_get('proyectos_operativos_muestra_sa', TRUE); |
---|
597 | $so = variable_get('proyectos_operativos_muestra_so', TRUE); |
---|
598 | ?> |
---|
599 | <?php if ($sa || $so): ?> |
---|
600 | <h3><?php print t('Indicador de la Situación');?></h3> |
---|
601 | <?php if ($sa): ?> |
---|
602 | <h4><?php print t('Situación Actual');?></h4> |
---|
603 | <?php |
---|
604 | $arreglo = array( |
---|
605 | 'field_proyecto_sa_descripcion' => 'field_proyecto_sa_descripcion', |
---|
606 | ); |
---|
607 | if (variable_get('proyectos_operativos_muestra_sa_cuantificacion', TRUE)) { |
---|
608 | $arreglo['field_proyecto_sa_cuantificacion'] = 'field_proyecto_sa_cuantificacion'; |
---|
609 | } |
---|
610 | $arreglo['field_proyecto_sa_formulai'] = 'field_proyecto_sa_formulai'; |
---|
611 | $arreglo['field_proyecto_sa_fuentei'] = 'field_proyecto_sa_fuentei'; |
---|
612 | $arreglo['field_proyecto_sa_fecha'] = 'field_proyecto_sa_fecha'; |
---|
613 | ?> |
---|
614 | <?php foreach($arreglo as $campo): ?> |
---|
615 | <?php print drupal_render($content->content[$campo]); ?> |
---|
616 | <?php endforeach ?> |
---|
617 | <?php endif ?> |
---|
618 | <?php if ($so): ?> |
---|
619 | <h4><?php print t('Situación Objetivo');?></h4> |
---|
620 | <?php |
---|
621 | $arreglo = array( |
---|
622 | 'field_proyecto_so_descripcion' => 'field_proyecto_so_descripcion', |
---|
623 | 'field_proyecto_tiempoi' => 'field_proyecto_tiempoi', |
---|
624 | ); |
---|
625 | ?> |
---|
626 | <?php foreach($arreglo as $campo): ?> |
---|
627 | <?php print drupal_render($content->content[$campo]); ?> |
---|
628 | <?php endforeach ?> |
---|
629 | <?php endif ?> |
---|
630 | <?php endif ?> |
---|
631 | <h3><?php print t('Indicador del resultado del Proyecto');?></h3> |
---|
632 | <?php |
---|
633 | $arreglo = array( |
---|
634 | 'field_proyecto_descripcion_bien' => 'field_proyecto_descripcion_bien', |
---|
635 | 'field_proyecto_so_cuantificacion' => 'field_proyecto_so_cuantificacion', |
---|
636 | 'field_proyecto_unidadm' => 'field_proyecto_unidadm', |
---|
637 | 'field_proyecto_meta_fisica' => 'field_proyecto_meta_fisica', |
---|
638 | ); |
---|
639 | if (module_exists('proyectos_reformulacion')) { |
---|
640 | $arreglo['field_proyecto_unidadm'] = 'proyectos_operativos_unidad_medida_reformulado'; |
---|
641 | $arreglo['field_proyecto_meta_fisica'] = 'proyectos_operativos_meta_fisica_reformulado'; |
---|
642 | } |
---|
643 | ?> |
---|
644 | <?php foreach($arreglo as $campo): ?> |
---|
645 | <?php print drupal_render($content->content[$campo]); ?> |
---|
646 | <?php endforeach ?> |
---|
647 | <h3><?php print t('Acciones EspecÃficas');?></h3> |
---|
648 | <?php print drupal_render($content->content['field_proyecto_accion_esp']); ?> |
---|