1 | <?php |
---|
2 | |
---|
3 | function _tabla_seg_proyecto_estadomes_page($node, $mes=0) { |
---|
4 | |
---|
5 | $meses = array( |
---|
6 | 0 => t('January'), |
---|
7 | 1 => t('February'), |
---|
8 | 2 => t('March'), |
---|
9 | 3 => t('April'), |
---|
10 | 4 => t('May'), |
---|
11 | 5 => t('June'), |
---|
12 | 6 => t('July'), |
---|
13 | 7 => t('August'), |
---|
14 | 8 => t('September'), |
---|
15 | 9 => t('Octuber'), |
---|
16 | 10 => t('November'), |
---|
17 | 11 => t('December'), |
---|
18 | ); |
---|
19 | |
---|
20 | $tablas = array(); |
---|
21 | |
---|
22 | $header = array(); |
---|
23 | $header[] = array('data' => t('Mes'),'style' => 'text-align:center',); |
---|
24 | $header[] = array('data' => t('Estado'), 'colspan' => 2, 'style' => 'text-align:center',); |
---|
25 | $header[] = array('data' => t('Opciones Disponibles'),'style' => 'text-align:center',); |
---|
26 | |
---|
27 | $rows = array(); |
---|
28 | |
---|
29 | $row = array(); |
---|
30 | $row[] = array('data' => $meses[$mes],); |
---|
31 | |
---|
32 | //si es accion especifica y si el mes pertenece a la duracion |
---|
33 | |
---|
34 | //calcular el estado |
---|
35 | $transiciones_dispo = _obtener_transiciones_disponibles_proyecto($node, $mes); |
---|
36 | $nivel_usuario = _obtener_nivel_usuario_segun_estado($transiciones_dispo['nombre_estado_actual']); |
---|
37 | //echo print_r($transiciones_dispo).'<br>'; |
---|
38 | //echo print_r().'<br>'; |
---|
39 | |
---|
40 | if(isset($transiciones_dispo['nombre_estado_actual'])){ |
---|
41 | $colorSemaforo = _calcular_color_semaforo_estado_actual($transiciones_dispo['nombre_estado_actual']); |
---|
42 | $row[] = array('data' => 'â¢', 'style' => 'font-weight: bold;font-size: 35px;text-align:center; color:' . $colorSemaforo); |
---|
43 | $row[] = array('data' => $transiciones_dispo['nombre_estado_actual'],); |
---|
44 | }else{ |
---|
45 | if(isset($transiciones_dispo['estado_actual'])&& $transiciones_dispo['estado_actual'] < 0){ |
---|
46 | $row[] = array('data' => '-',); |
---|
47 | $row[] = array('data' => 'Por Ingresar',); |
---|
48 | /*if(_periodo_de_seguimiento_proyecto_y_aes_esta_activo()&&_mes_habilitado_para_seguimiento($mes)){ |
---|
49 | $links= array(); |
---|
50 | $links[] = '<b>'.l(t('Ingresar'), 'node/'.$node->nid.'/seguimiento_proyecto/mes/'.$mes.'/edit').'</b>'; |
---|
51 | $row[] = array('data' => theme('item_list', $links),); |
---|
52 | }*/ |
---|
53 | }else{ |
---|
54 | $row[] = array('data' => '-',); |
---|
55 | $row[] = array('data' => '-',); |
---|
56 | //$row[] = array('data' => '-',); |
---|
57 | } |
---|
58 | } |
---|
59 | |
---|
60 | $links = array(); |
---|
61 | //echo print_r($row).'<br>'; |
---|
62 | |
---|
63 | if(_periodo_de_seguimiento_proyecto_y_aes_esta_activo()){ |
---|
64 | |
---|
65 | if(_mes_habilitado_para_seguimiento($mes)){ |
---|
66 | |
---|
67 | $rol_ente_usuario = _obtener_rol_y_ente_de_usuario(); |
---|
68 | |
---|
69 | //echo $nivel_usuario.'-'.$rol_ente_usuario['rol']; |
---|
70 | //esta en el mismo nivel de usuario o es administrador => |
---|
71 | if(($nivel_usuario == $rol_ente_usuario['rol']) || $rol_ente_usuario['rol']=='administrador'){//nivel de usuario == rol actor |
---|
72 | |
---|
73 | //verificar que tenga el mismo ente planificador (para enlace o supervisor) |
---|
74 | if($rol_ente_usuario['rol']=='enlace'||$rol_ente_usuario['rol']=='supervisor'){//enlace o supervisor |
---|
75 | if($rol_ente_usuario['id_ente'] == $node->field_proyecto_ente[0]['nid']){//deben ser del mismo ente que el proyecto |
---|
76 | //echo 'aaaaaaaaaaa'; |
---|
77 | if(isset($transiciones_dispo['nombre_estado_actual'])){ |
---|
78 | //echo $transiciones_dispo['nombre_estado_actual'].'<br>'; |
---|
79 | $links[] = '<b>'.l(t('Modificar'), 'node/'.$node->nid.'/seguimiento_proyecto/mes/'.$mes.'/edit').'</b>'; |
---|
80 | foreach($transiciones_dispo['transic'] as $id => $estado_i){ |
---|
81 | $expr_mach = _nombres_estado_y_transiciones($estado_i); |
---|
82 | if(isset($expr_mach['nombre_corto'])){ |
---|
83 | $links[] = '<b>'.l(t($expr_mach['nombre_corto']), 'node/'.$node->nid.'/seguimiento_proyecto/'.$mes.'/workflow/'.$id).'</b>'; |
---|
84 | }else{ |
---|
85 | $links[] = '<b>'.l(t('cambiar estado a '.$estado_i), 'enlace').'</b>'; |
---|
86 | } |
---|
87 | } |
---|
88 | $links[] = '<b>'.l(t('Ver Historial'), 'node/'.$node->nid.'/seguimiento_proyecto/'.$mes.'/workflow/historial').'</b>'; |
---|
89 | //node/14/seguimiento_proyecto/8/workflow/historial |
---|
90 | }else{ |
---|
91 | //echo print_r($row).'<br>'; |
---|
92 | //$row[] = array('data' => 'Por_ingresar',); |
---|
93 | //if(($rol_ente_usuario['rol']=='enlace')&&($row[2]['data']=='Por Ingresar')){ |
---|
94 | //$row[] = array('data' => 'Por Ingresar',); |
---|
95 | $links[] = '<b>'.l(t('Ingresar'), 'node/'.$node->nid.'/seguimiento_proyecto/mes/'.$mes.'/edit').'</b>'; |
---|
96 | //} |
---|
97 | } |
---|
98 | |
---|
99 | } |
---|
100 | }else{// control o administrador |
---|
101 | if(isset($transiciones_dispo['nombre_estado_actual'])){ |
---|
102 | if(!_seg_esta_aprobado_proyecto($node, $mes)){ |
---|
103 | $links[] = '<b>'.l(t('Modificar'), 'node/'.$node->nid.'/seguimiento_proyecto/mes/'.$mes.'/edit').'</b>'; |
---|
104 | } |
---|
105 | foreach($transiciones_dispo['transic'] as $id => $estado_i){ |
---|
106 | $expr_mach = _nombres_estado_y_transiciones($estado_i); |
---|
107 | if(isset($expr_mach['nombre_corto'])){ |
---|
108 | $links[] = '<b>'.l(t($expr_mach['nombre_corto']), 'node/'.$node->nid.'/seguimiento_proyecto/'.$mes.'/workflow/'.$id).'</b>'; |
---|
109 | }else{ |
---|
110 | $links[] = '<b>'.l(t('cambiar estado a '.$estado_i), 'enlace').'</b>'; |
---|
111 | } |
---|
112 | } |
---|
113 | $links[] = '<b>'.l(t('Ver Historial'), 'node/'.$node->nid.'/seguimiento_proyecto/'.$mes.'/workflow/historial').'</b>'; |
---|
114 | }else{ |
---|
115 | if($rol_ente_usuario['rol']=='administrador'){ |
---|
116 | $links[] = '<b>'.l(t('Ingresar'), 'node/'.$node->nid.'/seguimiento_proyecto/mes/'.$mes.'/edit').'</b>'; |
---|
117 | } |
---|
118 | } |
---|
119 | } |
---|
120 | }else{ |
---|
121 | if(isset($transiciones_dispo['nombre_estado_actual'])){ |
---|
122 | $links[] = '<b>'.l(t('Ver Historial'), 'node/'.$node->nid.'/seguimiento_proyecto/'.$mes.'/workflow/historial').'</b>'; |
---|
123 | }else{ |
---|
124 | if(($rol_ente_usuario['rol']=='enlace')&&($rol_ente_usuario['id_ente'] == $node->field_proyecto_ente[0]['nid'])){ |
---|
125 | $links[] = '<b>'.l(t('Ingresar'), 'node/'.$node->nid.'/seguimiento_proyecto/mes/'.$mes.'/edit').'</b>'; |
---|
126 | } |
---|
127 | } |
---|
128 | } |
---|
129 | $row[] = array('data' => theme('item_list', $links),); |
---|
130 | |
---|
131 | }else{ |
---|
132 | $row[] = array('data' => '',); |
---|
133 | $nota_piepagina = t('Mes no habilitado para seguimiento.'); |
---|
134 | } |
---|
135 | |
---|
136 | }else{ |
---|
137 | $row[] = array('data' => '',); |
---|
138 | $nota_piepagina = t('PerÃodo para seguimiento no activo.'); |
---|
139 | } |
---|
140 | |
---|
141 | //********************************************************************************************************* |
---|
142 | |
---|
143 | $rows[] = $row; |
---|
144 | |
---|
145 | $tablas[]= theme('table', $header, $rows); |
---|
146 | |
---|
147 | $output = ''; |
---|
148 | |
---|
149 | if (count($tablas)) { |
---|
150 | $output .= '<b>' . t('Proyecto Operativo') . ': '.$node->titulo_asignado.'</b>'; |
---|
151 | $output .= '<br>'; |
---|
152 | $output .= implode('', $tablas); |
---|
153 | if(isset($nota_piepagina)){ |
---|
154 | $output .= '<b>' . t('Nota complementaria') . '</b>: '.$nota_piepagina.'<br>'; |
---|
155 | } |
---|
156 | $output .= '<br>'; |
---|
157 | $output .= t('Para consultar el seguimiento de todos los meses de duración de este Proyecto ir a') . ' <b>'.l(t('Seguimiento del Proyecto'), 'node/'.$node->nid.'/seguimiento_proyecto').'.</b>'; |
---|
158 | $output .= '<br>'; |
---|
159 | $output .= '<br>'; |
---|
160 | } |
---|
161 | |
---|
162 | return $output; |
---|
163 | } |
---|
164 | |
---|
165 | function _tabla_seg_aeproyecto_estadomes_page($node, $mes=0) { |
---|
166 | |
---|
167 | $meses = array( |
---|
168 | 0 => t('January'), |
---|
169 | 1 => t('February'), |
---|
170 | 2 => t('March'), |
---|
171 | 3 => t('April'), |
---|
172 | 4 => t('May'), |
---|
173 | 5 => t('June'), |
---|
174 | 6 => t('July'), |
---|
175 | 7 => t('August'), |
---|
176 | 8 => t('September'), |
---|
177 | 9 => t('Octuber'), |
---|
178 | 10 => t('November'), |
---|
179 | 11 => t('December'), |
---|
180 | ); |
---|
181 | |
---|
182 | $tablas = array(); |
---|
183 | |
---|
184 | $header = array(); |
---|
185 | $header[] = array('data' => t('Mes'),'style' => 'text-align:center',); |
---|
186 | $header[] = array('data' => t('Estado'), 'colspan' => 2, 'style' => 'text-align:center',); |
---|
187 | $header[] = array('data' => t('Opciones Disponibles'),'style' => 'text-align:center',); |
---|
188 | |
---|
189 | $rows = array(); |
---|
190 | |
---|
191 | $row = array(); |
---|
192 | $links = array(); |
---|
193 | $row[] = array('data' => $meses[$mes],); |
---|
194 | |
---|
195 | if(_accion_especifica_de_proyecto_seguimiento_consultar_mes_access($node, $mes)){ |
---|
196 | //si es accion especifica y si el mes pertenece a la duracion |
---|
197 | |
---|
198 | //calcular el estado |
---|
199 | $transiciones_dispo = _obtener_transiciones_disponibles($node, $mes); |
---|
200 | $nivel_usuario = _obtener_nivel_usuario_segun_estado($transiciones_dispo['nombre_estado_actual']); |
---|
201 | |
---|
202 | if(isset($transiciones_dispo['nombre_estado_actual'])){ |
---|
203 | $colorSemaforo = _calcular_color_semaforo_estado_actual($transiciones_dispo['nombre_estado_actual']); |
---|
204 | $row[] = array('data' => 'â¢', 'style' => 'font-weight: bold;font-size: 35px;text-align:center; color:' . $colorSemaforo); |
---|
205 | $row[] = array('data' => $transiciones_dispo['nombre_estado_actual'],); |
---|
206 | }else{ |
---|
207 | if(isset($transiciones_dispo['estado_actual'])&& $transiciones_dispo['estado_actual'] < 0){ |
---|
208 | $row[] = array('data' => '-',); |
---|
209 | $row[] = array('data' => t('Por Ingresar'),); |
---|
210 | /*if(_periodo_de_seguimiento_proyecto_y_aes_esta_activo()&&_mes_habilitado_para_seguimiento($mes)){ |
---|
211 | $links= array(); |
---|
212 | $links[] = '<b>'.l(t('Ingresar'), 'node/'.$node->nid.'/seguimiento_proyecto/mes/'.$mes.'/edit').'</b>'; |
---|
213 | $row[] = array('data' => theme('item_list', $links),); |
---|
214 | }*/ |
---|
215 | }else{ |
---|
216 | $row[] = array('data' => '-',); |
---|
217 | $row[] = array('data' => '-',); |
---|
218 | //$row[] = array('data' => '-',); |
---|
219 | } |
---|
220 | } |
---|
221 | |
---|
222 | |
---|
223 | if(_periodo_de_seguimiento_proyecto_y_aes_esta_activo()){ |
---|
224 | |
---|
225 | if(_mes_habilitado_para_seguimiento($mes)){ |
---|
226 | |
---|
227 | $rol_ente_usuario = _obtener_rol_y_ente_de_usuario(); |
---|
228 | //echo print_r($rol_ente_usuario).'<br>'; |
---|
229 | //echo print_r($rol_ente_usuario).'-'.$nivel_usuario.'<br>'; |
---|
230 | if(($nivel_usuario == $rol_ente_usuario['rol'])||$rol_ente_usuario['rol']=='administrador'){//nivel de usuario == rol actor |
---|
231 | |
---|
232 | if($rol_ente_usuario['rol']=='enlace'||$rol_ente_usuario['rol']=='supervisor'){//enlace o supervisor |
---|
233 | $nodo_proyecto = node_load($node->field_accion_esp_proyecto[0]['nid']); |
---|
234 | //echo $rol_ente_usuario['id_ente'] .'-'.$nodo_proyecto->field_proyecto_ente[0]['nid'].'<br>'; |
---|
235 | if($rol_ente_usuario['id_ente'] == $nodo_proyecto->field_proyecto_ente[0]['nid']){//deben ser del mismo ente que el proyecto |
---|
236 | |
---|
237 | |
---|
238 | if(isset($transiciones_dispo['nombre_estado_actual'])){ |
---|
239 | //echo $transiciones_dispo['nombre_estado_actual'].'<br>'; |
---|
240 | $links[] = '<b>'.l(t('Modificar'), 'node/'.$node->nid.'/seguimiento_aeproyecto/partidas/'.$mes.'/edit').'</b>'; |
---|
241 | foreach($transiciones_dispo['transic'] as $id => $estado_i){ |
---|
242 | $expr_mach = _nombres_estado_y_transiciones($estado_i); |
---|
243 | if(isset($expr_mach['nombre_corto'])){ |
---|
244 | $links[] = '<b>'.l(t($expr_mach['nombre_corto']), 'node/'.$node->nid.'/seguimiento_aeproyecto/'.$mes.'/workflow/'.$id).'</b>'; |
---|
245 | }else{ |
---|
246 | $links[] = '<b>'.l(t('cambiar estado a '.$estado_i), 'enlace').'</b>'; |
---|
247 | } |
---|
248 | } |
---|
249 | $links[] = '<b>'.l(t('Ver Historial'), 'node/'.$node->nid.'/seguimiento_aeproyecto/'.$mes.'/workflow/historial').'</b>'; |
---|
250 | //node/%node/seguimiento_aeproyecto/%messegaepartida/workflow/historial |
---|
251 | }else{ |
---|
252 | //$row[] = array('data' => 'Por_ingresar',); |
---|
253 | $links[] = '<b>'.l(t('Ingresar'), 'node/'.$node->nid.'/seguimiento_aeproyecto/partidas/'.$mes.'/edit').'</b>'; |
---|
254 | } |
---|
255 | |
---|
256 | } |
---|
257 | }else{// control o administrador |
---|
258 | if(isset($transiciones_dispo['nombre_estado_actual'])){ |
---|
259 | if(!_seg_esta_aprobado($node, $mes)){ |
---|
260 | $links[] = '<b>'.l(t('Modificar'), 'node/'.$node->nid.'/seguimiento_aeproyecto/partidas/'.$mes.'/edit').'</b>'; |
---|
261 | } |
---|
262 | foreach($transiciones_dispo['transic'] as $id => $estado_i){ |
---|
263 | $expr_mach = _nombres_estado_y_transiciones($estado_i); |
---|
264 | if(isset($expr_mach['nombre_corto'])){ |
---|
265 | $links[] = '<b>'.l(t($expr_mach['nombre_corto']), 'node/'.$node->nid.'/seguimiento_aeproyecto/'.$mes.'/workflow/'.$id).'</b>'; |
---|
266 | }else{ |
---|
267 | $links[] = '<b>'.l(t('cambiar estado a '.$estado_i), 'enlace').'</b>'; |
---|
268 | } |
---|
269 | } |
---|
270 | $links[] = '<b>'.l(t('Ver Historial'), 'node/'.$node->nid.'/seguimiento_aeproyecto/'.$mes.'/workflow/historial').'</b>'; |
---|
271 | }else{ |
---|
272 | if($rol_ente_usuario['rol']=='administrador'){ |
---|
273 | $links[] = '<b>'.l(t('Ingresar'), 'node/'.$node->nid.'/seguimiento_aeproyecto/partidas/'.$mes.'/edit').'</b>'; |
---|
274 | } |
---|
275 | } |
---|
276 | } |
---|
277 | }else{ |
---|
278 | if(isset($transiciones_dispo['nombre_estado_actual'])){ |
---|
279 | $links[] = '<b>'.l(t('Ver Historial'), 'node/'.$node->nid.'/seguimiento_aeproyecto/'.$mes.'/workflow/historial').'</b>'; |
---|
280 | }else{ |
---|
281 | $nodo_proyecto = node_load($node->field_accion_esp_proyecto[0]['nid']); |
---|
282 | if((($rol_ente_usuario['rol']=='enlace')&&($rol_ente_usuario['id_ente'] == $nodo_proyecto->field_proyecto_ente[0]['nid']))||$rol_ente_usuario['rol']=='administrador'){ |
---|
283 | $links[] = '<b>'.l(t('Ingresar'), 'node/'.$node->nid.'/seguimiento_aeproyecto/partidas/'.$mes.'/edit').'</b>'; |
---|
284 | } |
---|
285 | } |
---|
286 | } |
---|
287 | |
---|
288 | $row[] = array('data' => theme('item_list', $links),); |
---|
289 | |
---|
290 | }else{ |
---|
291 | $row[] = array('data' => '',); |
---|
292 | $nota_piepagina = t('Mes no habilitado para seguimiento.'); |
---|
293 | } |
---|
294 | |
---|
295 | }else{ |
---|
296 | $row[] = array('data' => '',); |
---|
297 | $nota_piepagina = t('PerÃodo para seguimiento no activo.'); |
---|
298 | } |
---|
299 | |
---|
300 | }else{ |
---|
301 | $row[] = array('data' => '-',); |
---|
302 | $row[] = array('data' => t('No_ingresable'),); |
---|
303 | $row[] = array('data' => '',); |
---|
304 | $nota_piepagina = t('Mes fuera del perÃodo de duración de la acción especÃfica.'); |
---|
305 | } |
---|
306 | |
---|
307 | $rows[] = $row; |
---|
308 | |
---|
309 | $tablas[]= theme('table', $header, $rows); |
---|
310 | |
---|
311 | $output = ''; |
---|
312 | |
---|
313 | if (count($tablas)) { |
---|
314 | $output .= '<b>' . t('Acción EspecÃfica') . ': '.$node->titulo_asignado.'</b>'; |
---|
315 | $output .= '<br>'; |
---|
316 | $output .= implode('', $tablas); |
---|
317 | if(isset($nota_piepagina)){ |
---|
318 | $output .= '<b>' . t('Nota complementaria') . '</b>: '.$nota_piepagina.'<br>'; |
---|
319 | } |
---|
320 | $output .= '<br>'; |
---|
321 | $output .= t('Para consultar el seguimiento de todos los meses de duración de esta Acción EspecÃfica ir a') . ' <b>'.l(t('Seguimiento de la Acción EspecÃfica'), 'node/'.$node->nid.'/seguimiento_aeproyecto').'.</b>'; |
---|
322 | $output .= '<br>'; |
---|
323 | $output .= '<br>'; |
---|
324 | $output .= '<hr>'; |
---|
325 | } |
---|
326 | |
---|
327 | return $output; |
---|
328 | } |
---|
329 | |
---|
330 | /** |
---|
331 | * Pagina que muestra los seguimientos de todos los meses de una ae (cuadro resumen de seguimientos) |
---|
332 | * 15 de marzo por Diego Uzcátegui |
---|
333 | */ |
---|
334 | function fase_de_seguimiento_proyecto_y_aes_page($node, $mes=0) { |
---|
335 | |
---|
336 | $meses = array( |
---|
337 | 0 => t('January'), |
---|
338 | 1 => t('February'), |
---|
339 | 2 => t('March'), |
---|
340 | 3 => t('April'), |
---|
341 | 4 => t('May'), |
---|
342 | 5 => t('June'), |
---|
343 | 6 => t('July'), |
---|
344 | 7 => t('August'), |
---|
345 | 8 => t('September'), |
---|
346 | 9 => t('Octuber'), |
---|
347 | 10 => t('November'), |
---|
348 | 11 => t('December'), |
---|
349 | ); |
---|
350 | |
---|
351 | drupal_set_title(t('Fase de Seguimiento de Proyecto Operativo y sus Acciones EspecÃficas (mes de %mes_asignado)', array('%mes_asignado' => $meses[$mes]))); |
---|
352 | |
---|
353 | $output = ''; |
---|
354 | $output .= '<br>'; |
---|
355 | $output .= t('Estimado(a) Usuario(a), para ingresar el <b>Seguimiento del Proyecto Operativo</b> debe <i>ingresar primero</i> los <b>Seguimiento de las Acciones EspecÃficas</b> del mismo, los cuales se muestran a continuación.<br>'); |
---|
356 | $output .= '<br>'; |
---|
357 | |
---|
358 | $output .= '<h3>' . t('Seguimiento y Control de las Acciones EspecÃficas del Proyecto') . '</h3>'; |
---|
359 | $output .= '<fieldset><legend>' . t('Seguimiento y Control de las Acciones EspecÃficas del Proyecto') . '</legend>'; |
---|
360 | foreach($node->field_proyecto_accion_esp as $accion) {//recorrido por todas las acciones especificas |
---|
361 | $accion_esp_load = node_load($accion['nid']); |
---|
362 | if ($accion_esp_load && $accion_esp_load->type == 'accion_especifica') {//accion especifica cargada |
---|
363 | $output .= _tabla_seg_aeproyecto_estadomes_page($accion_esp_load, $mes); |
---|
364 | |
---|
365 | //module_load_include('inc', 'accion_especifica_de_proyecto_seguimiento' , 'includes/fase_seguimiento_ae_proyecto.pages'); |
---|
366 | //$output .= _tabla_seg_aeproyecto_estadomes_page2($accion_esp_load, $mes); |
---|
367 | } |
---|
368 | } |
---|
369 | $output .= '</fieldset>'; |
---|
370 | |
---|
371 | $output .= '<h3>' . t('Seguimiento y Control del Proyecto Operativo') . '</h3>'; |
---|
372 | //$output .= '<img src="img/seg_proyecto.jpeg">'; |
---|
373 | $output .= '<fieldset><legend>' . t('Seguimiento y Control del Proyecto Operativo') . '</legend>'; |
---|
374 | $output .= _tabla_seg_proyecto_estadomes_page($node, $mes); |
---|
375 | $output .= '</fieldset>'; |
---|
376 | //$output .= _estado_seg_en_nivel_de_usuario_proyecto($node, $mes); |
---|
377 | |
---|
378 | return $output; |
---|
379 | } |
---|
380 | |
---|
381 | /** |
---|
382 | * Obtener mes de seguimiento actual si esta dentro del period o de duración, o retornar primer mes del proyecto |
---|
383 | * 18 de marzo por Diego Uzcátegui |
---|
384 | */ |
---|
385 | //function primermes_proyecto_page($node) { |
---|
386 | function _obtener_mes_fase_seguimiento_proyecto($node) { |
---|
387 | |
---|
388 | $mes_seguimiento_proyecto_y_aes = variable_get('accion_especifica_de_proyecto_seguimiento_mes_seguimiento', 0); |
---|
389 | $mes_seguimiento_proyecto_y_aes = $mes_seguimiento_proyecto_y_aes -1; |
---|
390 | if(_mes_dentro_de_duracion_proyecto($node, $mes_seguimiento_proyecto_y_aes)){ |
---|
391 | return $mes_seguimiento_proyecto_y_aes; |
---|
392 | }else{ |
---|
393 | //Proyecto |
---|
394 | if ($node->type == 'proyectos_operativos'){ |
---|
395 | //consultar mes de inicio del proyecto |
---|
396 | $fechayhora_inicio = $node->field_proyecto_fecha_i[0]['value']; |
---|
397 | list($fecha_inicio, $hora_inicio) = split('[ ]', $fechayhora_inicio); |
---|
398 | list($anno_inicio, $mes_inicio, $dia_inicio) = split('[/.-]', $fecha_inicio); |
---|
399 | $m_inicio = intval($mes_inicio); |
---|
400 | } |
---|
401 | $primermes = $m_inicio-1; |
---|
402 | return $primermes; |
---|
403 | } |
---|
404 | return 0; |
---|
405 | } |
---|