Conjunto 6a22cd8 en sipp
- Fecha y hora:
- 23/10/2015 17:39:27 (hace 9 años)
- Branches:
- 0.3-stable
- Children:
- e987163
- Parents:
- dc9049f
- Fichero:
-
- 1 editado
Leyenda
- No modificado
- Añadido
- Eliminado
-
0.3-stable-modules/proyectos_operativos_seguimiento/includes/fase_de_seguimiento_proyecto_y_aes.pages.inc
ra0b4327 r6a22cd8 1 1 <?php 2 2 3 function _tabla_seg_proyecto_estadomes_page($node, $mes=0) { 4 3 function _tabla_seg_proyecto_estadomes_page($node, $mes=0) { 5 4 $meses = array( 6 5 0 => t('January'), … … 17 16 11 => t('December'), 18 17 ); 19 20 18 $tablas = array(); 21 22 19 $header = array(); 20 $row = array(); 21 $rows = array(); 23 22 $header[] = array('data' => t('Mes'),'style' => 'text-align:center',); 24 23 $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(); 24 $header[] = array('data' => t('Opciones Disponibles'),'style' => 'text-align:center',); 25 30 26 $row[] = array('data' => $meses[$mes],); 31 27 … … 35 31 $transiciones_dispo = _obtener_transiciones_disponibles_proyecto($node, $mes); 36 32 $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 33 40 if (isset($transiciones_dispo['nombre_estado_actual'])){34 if (isset($transiciones_dispo['nombre_estado_actual'])) { 41 35 $colorSemaforo = _calcular_color_semaforo_estado_actual($transiciones_dispo['nombre_estado_actual']); 42 36 $row[] = array('data' => 'â¢', 'style' => 'font-weight: bold;font-size: 35px;text-align:center; color:' . $colorSemaforo); 43 37 $row[] = array('data' => $transiciones_dispo['nombre_estado_actual'],); 44 }else{ 45 if(isset($transiciones_dispo['estado_actual'])&& $transiciones_dispo['estado_actual'] < 0){ 38 } 39 else { 40 if (isset($transiciones_dispo['estado_actual']) && $transiciones_dispo['estado_actual'] < 0) { 46 41 $row[] = array('data' => '-',); 47 42 $row[] = array('data' => 'Por Ingresar',); … … 51 46 $row[] = array('data' => theme('item_list', $links),); 52 47 }*/ 53 }else{ 48 } 49 else { 54 50 $row[] = array('data' => '-',); 55 51 $row[] = array('data' => '-',); … … 59 55 60 56 $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 57 if (_periodo_de_seguimiento_proyecto_y_aes_esta_activo()) { 58 if (_mes_habilitado_para_seguimiento($mes)) { 67 59 $rol_ente_usuario = _obtener_rol_y_ente_de_usuario(); 68 69 //echo $nivel_usuario.'-'.$rol_ente_usuario['rol'];70 60 //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 61 if (($nivel_usuario == $rol_ente_usuario['rol']) || $rol_ente_usuario['rol']=='administrador') {//nivel de usuario == rol actor 73 62 //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>'; 63 if ($rol_ente_usuario['rol']=='enlace' || $rol_ente_usuario['rol']=='supervisor') {//enlace o supervisor 64 if ($rol_ente_usuario['id_ente'] == $node->field_proyecto_ente[0]['nid']) {//deben ser del mismo ente que el proyecto 65 if (isset($transiciones_dispo['nombre_estado_actual'])) { 79 66 $links[] = '<b>'.l(t('Modificar'), 'node/'.$node->nid.'/seguimiento_proyecto/mes/'.$mes.'/edit').'</b>'; 80 foreach ($transiciones_dispo['transic'] as $id => $estado_i){67 foreach ($transiciones_dispo['transic'] as $id => $estado_i) { 81 68 $expr_mach = _nombres_estado_y_transiciones($estado_i); 82 if (isset($expr_mach['nombre_corto'])){69 if (isset($expr_mach['nombre_corto'])) { 83 70 $links[] = '<b>'.l(t($expr_mach['nombre_corto']), 'node/'.$node->nid.'/seguimiento_proyecto/'.$mes.'/workflow/'.$id).'</b>'; 84 }else{ 71 } 72 else { 85 73 $links[] = '<b>'.l(t('cambiar estado a '.$estado_i), 'enlace').'</b>'; 86 74 } … … 88 76 $links[] = '<b>'.l(t('Ver Historial'), 'node/'.$node->nid.'/seguimiento_proyecto/'.$mes.'/workflow/historial').'</b>'; 89 77 //node/14/seguimiento_proyecto/8/workflow/historial 90 } else{91 //echo print_r($row).'<br>';78 } 79 else { 92 80 //$row[] = array('data' => 'Por_ingresar',); 93 81 //if(($rol_ente_usuario['rol']=='enlace')&&($row[2]['data']=='Por Ingresar')){ … … 98 86 99 87 } 100 }else{// control o administrador 101 if(isset($transiciones_dispo['nombre_estado_actual'])){ 102 if(!_seg_esta_aprobado_proyecto($node, $mes)){ 88 } 89 else {// control o administrador 90 if (isset($transiciones_dispo['nombre_estado_actual'])) { 91 if (!_seg_esta_aprobado_proyecto($node, $mes)) { 103 92 $links[] = '<b>'.l(t('Modificar'), 'node/'.$node->nid.'/seguimiento_proyecto/mes/'.$mes.'/edit').'</b>'; 104 93 } 105 foreach ($transiciones_dispo['transic'] as $id => $estado_i){94 foreach ($transiciones_dispo['transic'] as $id => $estado_i) { 106 95 $expr_mach = _nombres_estado_y_transiciones($estado_i); 107 if (isset($expr_mach['nombre_corto'])){96 if (isset($expr_mach['nombre_corto'])) { 108 97 $links[] = '<b>'.l(t($expr_mach['nombre_corto']), 'node/'.$node->nid.'/seguimiento_proyecto/'.$mes.'/workflow/'.$id).'</b>'; 109 }else{ 98 } 99 else { 110 100 $links[] = '<b>'.l(t('cambiar estado a '.$estado_i), 'enlace').'</b>'; 111 101 } 112 102 } 113 103 $links[] = '<b>'.l(t('Ver Historial'), 'node/'.$node->nid.'/seguimiento_proyecto/'.$mes.'/workflow/historial').'</b>'; 114 }else{ 115 if($rol_ente_usuario['rol']=='administrador'){ 104 } 105 else { 106 if ($rol_ente_usuario['rol']=='administrador') { 116 107 $links[] = '<b>'.l(t('Ingresar'), 'node/'.$node->nid.'/seguimiento_proyecto/mes/'.$mes.'/edit').'</b>'; 117 108 } 118 109 } 119 110 } 120 }else{ 121 if(isset($transiciones_dispo['nombre_estado_actual'])){ 111 } 112 else { 113 if (isset($transiciones_dispo['nombre_estado_actual'])) { 122 114 $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'])){ 115 } 116 else { 117 if (($rol_ente_usuario['rol']=='enlace')&&($rol_ente_usuario['id_ente'] == $node->field_proyecto_ente[0]['nid'])) { 125 118 $links[] = '<b>'.l(t('Ingresar'), 'node/'.$node->nid.'/seguimiento_proyecto/mes/'.$mes.'/edit').'</b>'; 126 119 } … … 128 121 } 129 122 $row[] = array('data' => theme('item_list', $links),); 130 131 }else{123 } 124 else { 132 125 $row[] = array('data' => '',); 133 126 $nota_piepagina = t('Mes no habilitado para seguimiento.'); 134 127 } 135 136 }else{128 } 129 else{ 137 130 $row[] = array('data' => '',); 138 131 $nota_piepagina = t('PerÃodo para seguimiento no activo.'); 139 132 } 140 141 133 //********************************************************************************************************* 142 143 134 $rows[] = $row; 144 145 135 $tablas[]= theme('table', $header, $rows); 146 147 136 $output = ''; 148 137 … … 151 140 $output .= '<br>'; 152 141 $output .= implode('', $tablas); 153 if (isset($nota_piepagina)){142 if (isset($nota_piepagina)) { 154 143 $output .= '<b>' . t('Nota complementaria') . '</b>: '.$nota_piepagina.'<br>'; 155 144 } … … 159 148 $output .= '<br>'; 160 149 } 161 162 150 return $output; 163 151 } 164 152 165 153 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 154 $meses = array( 155 0 => t('January'), 156 1 => t('February'), 157 2 => t('March'), 158 3 => t('April'), 159 4 => t('May'), 160 5 => t('June'), 161 6 => t('July'), 162 7 => t('August'), 163 8 => t('September'), 164 9 => t('Octuber'), 165 10 => t('November'), 166 11 => t('December'), 167 ); 182 168 $tablas = array(); 183 184 169 $header = array(); 185 170 $header[] = array('data' => t('Mes'),'style' => 'text-align:center',); … … 188 173 189 174 $rows = array(); 190 191 175 $row = array(); 192 176 $links = array(); 193 177 $row[] = array('data' => $meses[$mes],); 194 178 195 if (_accion_especifica_de_proyecto_seguimiento_consultar_mes_access($node, $mes)){179 if (_accion_especifica_de_proyecto_seguimiento_consultar_mes_access($node, $mes)) { 196 180 //si es accion especifica y si el mes pertenece a la duracion 197 198 181 //calcular el estado 199 182 $transiciones_dispo = _obtener_transiciones_disponibles($node, $mes); 200 183 $nivel_usuario = _obtener_nivel_usuario_segun_estado($transiciones_dispo['nombre_estado_actual']); 201 184 202 if (isset($transiciones_dispo['nombre_estado_actual'])){185 if (isset($transiciones_dispo['nombre_estado_actual'])) { 203 186 $colorSemaforo = _calcular_color_semaforo_estado_actual($transiciones_dispo['nombre_estado_actual']); 204 187 $row[] = array('data' => 'â¢', 'style' => 'font-weight: bold;font-size: 35px;text-align:center; color:' . $colorSemaforo); 205 188 $row[] = array('data' => $transiciones_dispo['nombre_estado_actual'],); 206 }else{ 207 if(isset($transiciones_dispo['estado_actual'])&& $transiciones_dispo['estado_actual'] < 0){ 189 } 190 else { 191 if (isset($transiciones_dispo['estado_actual'])&& $transiciones_dispo['estado_actual'] < 0) { 208 192 $row[] = array('data' => '-',); 209 193 $row[] = array('data' => t('Por Ingresar'),); … … 213 197 $row[] = array('data' => theme('item_list', $links),); 214 198 }*/ 215 }else{ 199 } 200 else { 216 201 $row[] = array('data' => '-',); 217 202 $row[] = array('data' => '-',); 218 203 //$row[] = array('data' => '-',); 219 204 } 220 } 221 222 223 if(_periodo_de_seguimiento_proyecto_y_aes_esta_activo()){ 224 225 if(_mes_habilitado_para_seguimiento($mes)){ 226 205 } 206 if (_periodo_de_seguimiento_proyecto_y_aes_esta_activo()) { 207 if (_mes_habilitado_para_seguimiento($mes)) { 227 208 $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 209 if (($nivel_usuario == $rol_ente_usuario['rol']) || $rol_ente_usuario['rol']=='administrador') {//nivel de usuario == rol actor 210 if ($rol_ente_usuario['rol']=='enlace' || $rol_ente_usuario['rol']=='supervisor') {//enlace o supervisor 233 211 $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>'; 212 if ($rol_ente_usuario['id_ente'] == $nodo_proyecto->field_proyecto_ente[0]['nid']) {//deben ser del mismo ente que el proyecto 213 if (isset($transiciones_dispo['nombre_estado_actual'])) { 240 214 $links[] = '<b>'.l(t('Modificar'), 'node/'.$node->nid.'/seguimiento_aeproyecto/partidas/'.$mes.'/edit').'</b>'; 241 foreach ($transiciones_dispo['transic'] as $id => $estado_i){215 foreach ($transiciones_dispo['transic'] as $id => $estado_i) { 242 216 $expr_mach = _nombres_estado_y_transiciones($estado_i); 243 if (isset($expr_mach['nombre_corto'])){217 if (isset($expr_mach['nombre_corto'])) { 244 218 $links[] = '<b>'.l(t($expr_mach['nombre_corto']), 'node/'.$node->nid.'/seguimiento_aeproyecto/'.$mes.'/workflow/'.$id).'</b>'; 245 }else{ 219 } 220 else { 246 221 $links[] = '<b>'.l(t('cambiar estado a '.$estado_i), 'enlace').'</b>'; 247 222 } … … 249 224 $links[] = '<b>'.l(t('Ver Historial'), 'node/'.$node->nid.'/seguimiento_aeproyecto/'.$mes.'/workflow/historial').'</b>'; 250 225 //node/%node/seguimiento_aeproyecto/%messegaepartida/workflow/historial 251 }else{ 226 } 227 else { 252 228 //$row[] = array('data' => 'Por_ingresar',); 253 229 $links[] = '<b>'.l(t('Ingresar'), 'node/'.$node->nid.'/seguimiento_aeproyecto/partidas/'.$mes.'/edit').'</b>'; 254 230 } 255 256 257 }else{// control o administrador258 if (isset($transiciones_dispo['nombre_estado_actual'])){259 if (!_seg_esta_aprobado($node, $mes)){231 } 232 } 233 else {// control o administrador 234 if (isset($transiciones_dispo['nombre_estado_actual'])) { 235 if (!_seg_esta_aprobado($node, $mes)) { 260 236 $links[] = '<b>'.l(t('Modificar'), 'node/'.$node->nid.'/seguimiento_aeproyecto/partidas/'.$mes.'/edit').'</b>'; 261 237 } 262 foreach ($transiciones_dispo['transic'] as $id => $estado_i){238 foreach ($transiciones_dispo['transic'] as $id => $estado_i) { 263 239 $expr_mach = _nombres_estado_y_transiciones($estado_i); 264 if (isset($expr_mach['nombre_corto'])){240 if (isset($expr_mach['nombre_corto'])) { 265 241 $links[] = '<b>'.l(t($expr_mach['nombre_corto']), 'node/'.$node->nid.'/seguimiento_aeproyecto/'.$mes.'/workflow/'.$id).'</b>'; 266 }else{ 242 } 243 else { 267 244 $links[] = '<b>'.l(t('cambiar estado a '.$estado_i), 'enlace').'</b>'; 268 245 } 269 246 } 270 247 $links[] = '<b>'.l(t('Ver Historial'), 'node/'.$node->nid.'/seguimiento_aeproyecto/'.$mes.'/workflow/historial').'</b>'; 271 }else{ 272 if($rol_ente_usuario['rol']=='administrador'){ 248 } 249 else { 250 if ($rol_ente_usuario['rol']=='administrador') { 273 251 $links[] = '<b>'.l(t('Ingresar'), 'node/'.$node->nid.'/seguimiento_aeproyecto/partidas/'.$mes.'/edit').'</b>'; 274 252 } 275 253 } 276 254 } 277 }else{ 278 if(isset($transiciones_dispo['nombre_estado_actual'])){ 255 } 256 else { 257 if (isset($transiciones_dispo['nombre_estado_actual'])) { 279 258 $links[] = '<b>'.l(t('Ver Historial'), 'node/'.$node->nid.'/seguimiento_aeproyecto/'.$mes.'/workflow/historial').'</b>'; 280 }else{ 259 } 260 else { 281 261 $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 262 if ((($rol_ente_usuario['rol']=='enlace')&&($rol_ente_usuario['id_ente'] == $nodo_proyecto->field_proyecto_ente[0]['nid']))||$rol_ente_usuario['rol']=='administrador') { 263 $links[] = '<b>'.l(t('Ingresar'), 'node/'.$node->nid.'/seguimiento_aeproyecto/partidas/'.$mes.'/edit').'</b>'; 264 } 265 } 266 } 288 267 $row[] = array('data' => theme('item_list', $links),); 289 290 }else{268 } 269 else { 291 270 $row[] = array('data' => '',); 292 271 $nota_piepagina = t('Mes no habilitado para seguimiento.'); 293 272 } 294 295 }else{273 } 274 else { 296 275 $row[] = array('data' => '',); 297 276 $nota_piepagina = t('PerÃodo para seguimiento no activo.'); 298 277 } 299 300 }else{278 } 279 else { 301 280 $row[] = array('data' => '-',); 302 281 $row[] = array('data' => t('No_ingresable'),); … … 304 283 $nota_piepagina = t('Mes fuera del perÃodo de duración de la acción especÃfica.'); 305 284 } 306 307 285 $rows[] = $row; 308 309 286 $tablas[]= theme('table', $header, $rows); 310 311 287 $output = ''; 312 313 288 if (count($tablas)) { 314 289 $output .= '<b>' . t('Acción EspecÃfica') . ': '.$node->titulo_asignado.'</b>'; 315 290 $output .= '<br>'; 316 291 $output .= implode('', $tablas); 317 if (isset($nota_piepagina)){292 if (isset($nota_piepagina)) { 318 293 $output .= '<b>' . t('Nota complementaria') . '</b>: '.$nota_piepagina.'<br>'; 319 294 } … … 324 299 $output .= '<hr>'; 325 300 } 326 327 301 return $output; 328 302 } … … 333 307 */ 334 308 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 309 $meses = array( 310 0 => t('January'), 311 1 => t('February'), 312 2 => t('March'), 313 3 => t('April'), 314 4 => t('May'), 315 5 => t('June'), 316 6 => t('July'), 317 7 => t('August'), 318 8 => t('September'), 319 9 => t('Octuber'), 320 10 => t('November'), 321 11 => t('December'), 322 ); 351 323 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 324 … … 355 327 $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 328 $output .= '<br>'; 357 358 329 $output .= '<h3>' . t('Seguimiento y Control de las Acciones EspecÃficas del Proyecto') . '</h3>'; 359 330 $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 especificas331 foreach ($node->field_proyecto_accion_esp as $accion) {//recorrido por todas las acciones especificas 361 332 $accion_esp_load = node_load($accion['nid']); 362 333 if ($accion_esp_load && $accion_esp_load->type == 'accion_especifica') {//accion especifica cargada … … 368 339 } 369 340 $output .= '</fieldset>'; 370 371 341 $output .= '<h3>' . t('Seguimiento y Control del Proyecto Operativo') . '</h3>'; 372 342 //$output .= '<img src="img/seg_proyecto.jpeg">'; … … 375 345 $output .= '</fieldset>'; 376 346 //$output .= _estado_seg_en_nivel_de_usuario_proyecto($node, $mes); 377 378 347 return $output; 379 348 } … … 388 357 $mes_seguimiento_proyecto_y_aes = variable_get('accion_especifica_de_proyecto_seguimiento_mes_seguimiento', 0); 389 358 $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{ 359 if (_mes_dentro_de_duracion_proyecto($node, $mes_seguimiento_proyecto_y_aes)) { 360 return $mes_seguimiento_proyecto_y_aes; 361 } 362 else { 393 363 //Proyecto 394 if ($node->type == 'proyectos_operativos') {364 if ($node->type == 'proyectos_operativos') { 395 365 //consultar mes de inicio del proyecto 396 366 $fechayhora_inicio = $node->field_proyecto_fecha_i[0]['value'];
Nota: Vea TracChangeset
para ayuda en el uso del visor de conjuntos de cambios.