Conjunto de cambios a0cf94c en sipes para 0.3-modules/proyectos_operativos/proyectos_operativos.module
- Fecha y hora:
- 08/06/2016 16:21:29 (hace 8 años)
- Branches:
- stable, version-3.0
- Children:
- 79821dd
- Parents:
- 78a3f26
- Fichero:
-
- 1 editado
Leyenda
- No modificado
- Añadido
- Eliminado
-
0.3-modules/proyectos_operativos/proyectos_operativos.module
r8c31f40 ra0cf94c 67 67 if ($op == 'delete') { 68 68 return user_access('admin planificador'); 69 //return (user_access('admin planificador') || _proyectos_operativos_edita_datos_ae_access($node)); 69 70 } 70 71 } … … 231 232 elseif ($node->type == 'accion_especifica') { 232 233 $node->title = $node->titulo_asignado; 234 235 236 237 $format_number = array( 238 'decimals' => variable_get('proyectos_operativos_number_decimals', 0), 239 'dec_point' => variable_get('proyectos_operativos_number_dec_point', ','), 240 'thousands_sep' => variable_get('proyectos_operativos_number_thousands_sep', '.'), 241 ); 242 $ftypes = array( 243 'value' => t('January'), 244 'value_1' => t('February'), 245 'value_2' => t('March'), 246 'value_3' => t('April'), 247 'value_4' => t('May'), 248 'value_5' => t('June'), 249 'value_6' => t('July'), 250 'value_7' => t('August'), 251 'value_8' => t('September'), 252 'value_9' => t('Octuber'), 253 'value_10' => t('November'), 254 'value_11' => t('December'), 255 ); 256 $proyecto = node_load($node->field_accion_esp_proyecto[0]['nid']); 257 $field = content_fields('field_accion_esp_programacion', 'accion_especifica'); 258 $tree = taxonomy_get_tree($field['vid']); 259 $vtid = $field['vtid']; 260 $partidas = array(); 261 if ($tree) { 262 foreach ($tree as $term) { 263 if (isset($vtid[$term->tid])) { 264 if ($term && module_exists('i18ntaxonomy') && i18ntaxonomy_vocabulary($term->vid) == I18N_TAXONOMY_LOCALIZE) { 265 $term->name = tt("taxonomy:term:$term->tid:name", $unidad_medida_term->name); 266 } 267 $partidas[$term->tid] = $term->name; 268 } 269 } 270 } 271 $partidas_nodo = array(); 272 foreach ($node->field_accion_esp_programacion as $partida) { 273 if(!empty($partida['tid'])) { 274 $partidas_nodo[$partida['tid']] = $partida; 275 } 276 } 277 $output = ''; 278 $output .= '<fieldset><legend>' . t('Distribución por Partidas Presupuestarias (Bs)') . '</legend>'; 279 $header = array(); 280 $header[] = array('data' => t('Partidas')); 281 foreach($ftypes as $id_field => $texto) { 282 $header[] = array('data' => $texto); 283 } 284 $header[] = array('data' => t('TOTAL')); 285 $rows = array(); 286 $rowsF = array(); 287 $totales = array(); 288 $totalT = 0; 289 $plant = array(); 290 $sumaplan = 0; 291 $sumaplanm = array(); 292 foreach($partidas as $tid => $grupo) { 293 $total = 0; 294 $total1 = 0; 295 $row = array(); 296 $row[] = array('data' => $grupo); 297 foreach($ftypes as $id_field => $texto) { 298 $min = $partidas_nodo[$tid][$id_field]; 299 if (!isset($plant[$tid])) { 300 $plant[$tid] = 0; 301 } 302 $totalT += $min; 303 $plant[$tid] += $min; 304 $total += $min; 305 $sumaplan += $min; 306 if (!isset($sumaplanm[$id_field])) { 307 $sumaplanm[$id_field] = 0; 308 } 309 $sumaplanm[$id_field] += $min; 310 $row[] = array('data' => number_format($min, $format_number['decimals'], $format_number['dec_point'], $format_number['thousands_sep']), ); 311 } 312 $row[] = array('data' => number_format($plant[$tid], $format_number['decimals'], $format_number['dec_point'], $format_number['thousands_sep']), ); 313 if ($plant[$tid] > 0) { 314 $rows[] = $row; 315 } 316 } 317 $row = array(); 318 $row[] = array('data' => '<b>' . t('TOTAL POR PARTIDAS') . '</b>', 'align' => 'right'); 319 foreach($ftypes as $id_field => $texto) { 320 $row[] = array('data' => '<b>' . number_format($sumaplanm[$id_field], $format_number['decimals'], $format_number['dec_point'], $format_number['thousands_sep']) . '</b>', ); 321 } 322 $row[] = array('data' => '<b>' . number_format($totalT, $format_number['decimals'], $format_number['dec_point'], $format_number['thousands_sep']) . '</b>', ); 323 $rows[] = $row; 324 $output .= theme('table', $header, $rows); 325 $output .= '</fieldset>'; 326 $node->content['accion_especifica_partidas_reformulado'] = array( 327 '#value' => $output, 328 '#weight' => 101, 329 ); 330 $output = ''; 331 332 //financiamiento 333 $arreglo_financiamiento = array(); 334 $accion_especifica_number_fields = variable_get('accion_especifica_number_fields', 4); 335 for($i = 0; $i < $accion_especifica_number_fields; $i++) { 336 $arreglo_financiamiento['financiamiento_' . $i] = variable_get('accion_especifica_financiamiento_label_' . $i, '') ? variable_get('accion_especifica_financiamiento_label_' . $i, '') : ''; 337 $arreglo_financiamiento_fields['financiamiento_' . $i] = variable_get('accion_especifica_financiamiento_options_' . $i, array()); 338 } 339 $rows = array(); 340 $row = array(); 341 $row1 = array(); 342 $sumalT = 0; 343 foreach($arreglo_financiamiento as $id_items => $titulo) { 344 $sumal = 0; 345 $output1 = '<fieldset><legend>' . $titulo . '</legend>'; 346 foreach($arreglo_financiamiento_fields[$id_items] as $id1) { 347 if ($id1) { 348 $field = content_fields($id1, 'accion_especifica'); 349 $min = $node->{$id1}[0]['value']; 350 if (!isset($sumafinm[$id_items])) { 351 $sumafinm[$id_items] = 0; 352 } 353 $sumafinm[$id_items] += $min; 354 $sumatotalf += $min; 355 $field = content_fields($id1, 'accion_especifica'); 356 $sumal += $min; 357 $sumalT += $min; 358 $output1 .= '<div class="field"><div class="field-label">' . $field['widget']['label'] . ':</div>' . '<div class="field-label-planificado">' . number_format($min, $format_number['decimals'], $format_number['dec_point'], $format_number['thousands_sep']) . '</div>' . '</div>'; 359 } 360 } 361 $output1 .= '</fieldset>'; 362 $row[] = array('data' => $output1, ); 363 $row1[] = array('data' => number_format($sumal, $format_number['decimals'], $format_number['dec_point'], $format_number['thousands_sep']), ); 364 } 365 $rows[] = $row; 366 $rows[] = $row1; 367 $row = array(); 368 $cantifuentes = count($arreglo_financiamiento); 369 $row[] = array('data' => '<b>' . t('TOTAL FUENTES DE FINANCIAMIENTO') . ':</b>', 'colspan' => ($cantifuentes - 1), 'align' => 'right'); 370 $row[] = array('data' => '<b>' . number_format($sumalT, $format_number['decimals'], $format_number['dec_point'], $format_number['thousands_sep']) . '</b>', ); 371 $rows[] = $row; 372 $output .= '<fieldset><legend>' . t('Distribución por fuentes de Financiamiento (Bs)') . '</legend>' . theme('table', array(), $rows) . '</fieldset>'; 373 $node->content['accion_especifica_fuentesfinanc_reformulado'] = array( 374 '#value' => $output, 375 '#weight' => 102, 376 ); 377 378 379 380 381 382 383 384 385 233 386 } 234 387 break; … … 310 463 * Menu access control callback. Determina si un usuario tiene acceso a editar el flujo de trabajo 311 464 */ 465 /* 312 466 function _proyectos_operativos_edita_datos_wk_access($node = NULL) { 313 467 global $user; 468 print "<pre>"; 469 print_r($node); 470 print "</pre>"; 471 314 472 $fecha = FALSE; 315 473 $ente = usuario_tiene_ente($user->uid); … … 321 479 } 322 480 $accesso = workflow_node_tab_access($node); 481 return $fecha && $accesso && _proyectos_operativos_edita_datos_financieros_access($node); 482 } 483 */ 484 function _proyectos_operativos_edita_datos_wk_access($node = NULL) { 485 global $user; 486 487 488 if (!isset($node->field_proyecto_ente[0]['nid'])) { 489 return FALSE; 490 } 491 $fecha = FALSE; 492 $ente = usuario_tiene_ente($user->uid); 493 $ente_planificador = ente_planificador_leer_ente_planificadores($node->field_proyecto_ente[0]['nid']); 494 $children = FALSE; 495 496 if (user_access('admin planificador')) { 497 $fecha = TRUE; 498 } 499 elseif ($ente_planificador->nid == $ente->nid) { 500 $fecha = TRUE; 501 } 502 elseif (module_exists('ente_planificador_hierarchical')) { 503 $fathers = _ente_planificador_hierarchical_get_descbyid($ente_planificador->nid, 1); 504 $fecha = isset($fathers[$ente->nid]) ? TRUE : FALSE; 505 } 506 //print $fecha . "hola"; 507 $accesso = workflow_node_tab_access($node); 508 //print _proyectos_operativos_edita_datos_financieros_access($node) . "aa"; 509 /* 510 print "<pre>"; 511 print_r($node); 512 print "</pre>"; 513 */ 323 514 return $fecha && $accesso && _proyectos_operativos_edita_datos_financieros_access($node); 324 515 } … … 398 589 $fecha = FALSE; 399 590 $ente = usuario_tiene_ente($user->uid); 591 /* 592 $children = FALSE; 593 if (module_exists('ente_planificador_hierarchical')) { 594 $fathers = _ente_planificador_hierarchical_get_descbyid($ente_planificador->nid,1); 595 $children = isset($fathers[$ente->nid]) ? TRUE : FALSE; 596 //$childrens = _ente_planificador_hierarchical_get_descbyid($fathers['nid'], 0); 597 //$children = isset($childrens[$ente->nid]) ? TRUE : FALSE; 598 } 599 if (($ente_planificador->nid != $ente->nid && !$children) && !user_access('admin planificador')) { 600 return FALSE; 601 } 602 */ 400 603 if ($ente_planificador->nid != $ente->nid && !user_access('admin planificador')) { 401 604 return FALSE; … … 406 609 } 407 610 if ($fecha) { 408 if ($ente->nid == $ente_planificador->nid ) {611 if ($ente->nid == $ente_planificador->nid || $children) { 409 612 $fecha = TRUE; 410 613 } … … 1130 1333 $form = array(); 1131 1334 $form['#node'] = $node; 1335 //print "<pre>";print_r($form['#node']);print "</pre>"; 1132 1336 $form['#ac'] = $ac; 1133 1337 $message = t('Esta seguro de eliminar la acción especifica @nombre?', array('@nombre' => $ac->titulo_asignado)); … … 1150 1354 foreach($proyecto->field_proyecto_accion_esp as $ac) { 1151 1355 if ($ac['nid'] != $nid) { 1152 $accion_esp[] = $ac['nid'];1356 $accion_esp[] = array('nid' => $ac['nid']); 1153 1357 } 1154 1358 } … … 1157 1361 $texto = t('Se elimino la acción especifica @nombre', array('@nombre' => $ac->titulo_asignado)); 1158 1362 $proyecto->log = $texto; 1363 //print "<pre>";print_r($proyecto);print "</pre>"; 1364 //juan(); 1365 //drupal_set_message("<pre>". print_r($proyecto, 1). "</pre>"); 1366 node_save($proyecto); 1159 1367 drupal_set_message($texto); 1160 1368 if (!$_REQUEST['destination']) { … … 1190 1398 print "</pre>"; 1191 1399 */ 1400 $form['submit']['#value'] = 'Enviar'; 1192 1401 $current = $form['node']['#value']->_workflow; 1193 1402 $form['#proyectos_operativos_states_d'] = array(); 1194 $options_worflow = $form['workflow']['Proyectos_Operativos']['#options']; 1403 $nombre = check_plain((t($form['#wf']->name))); 1404 $actual = $form['workflow'][$nombre]['#options'][$current]; 1405 unset($form['workflow'][$nombre]['#options'][$current]); 1406 if (!count($form['workflow'][$nombre]['#options'])) { 1407 drupal_set_title(t('El proyecto !proyecto se encuentra en estado !estado', array('!proyecto' => $node->title, '!estado' =>$actual))); 1408 } 1409 $options_worflow = $form['workflow'][$nombre]['#options']; 1410 $form['workflow'][$nombre]['#required'] = TRUE; 1411 //$wid = workflow_get_workflow_for_type('proyectos_operativos'); 1412 //$workflow = workflow_load($wid);i 1413 //$nombre = check_plain((t($form['#wf']->name))); 1414 //borrar la opcion del estado actual 1415 //unset($form['workflow'][$nombre]['#options'][$current]); 1416 /* 1417 print "<pre>"; 1418 print_r($form['workflow']); 1419 print "</pre>"; 1420 */ 1195 1421 if ($options_worflow) { 1196 1422 foreach($options_worflow as $sid => $state) { 1197 1423 if (variable_get('proyectos_operativos_state_d_' . $current . '_' . $sid, FALSE)) { 1198 1424 $form['#proyectos_operativos_states_d'][$sid] = $sid; 1199 $form['workflow'][ 'Proyectos_Operativos']['#options'][$sid] = t(variable_get('proyectos_operativos_state_tdevueltos', 'Devuelto a @state'), array('@state' => $form['workflow']['Proyectos_Operativos']['#options'][$sid]));1425 $form['workflow'][$nombre]['#options'][$sid] = t(variable_get('proyectos_operativos_state_tdevueltos', 'Devuelto a @state'), array('@state' => $form['workflow'][$nombre]['#options'][$sid])); 1200 1426 } 1201 1427 else { 1202 $form['workflow']['Proyectos_Operativos']['#options'][$sid] = t(variable_get('proyectos_operativos_state_tndevueltos', 'Enviado a @state'), array('@state' => $form['workflow']['Proyectos_Operativos']['#options'][$sid])); 1203 } 1204 } 1428 $form['workflow'][$nombre]['#options'][$sid] = t(variable_get('proyectos_operativos_state_tndevueltos', 'Enviado a @state'), array('@state' => $form['workflow'][$nombre]['#options'][$sid])); 1429 //$form['workflow'][$nombre]['#default_value'] = $sid; 1430 } 1431 } 1432 $form['workflow'][$nombre]['#default_value'] = $sid; 1205 1433 } 1206 1434 $form['#validate'][] = 'proyectos_operativos_cambia_workflow_description_validate'; … … 1287 1515 $node = $form_state['values']['node']; 1288 1516 $form_state['redirect'] = 'proyectosop/' . $node->nid; 1289 drupal_set_message(t('Se modifico el estado del proyecto.')); 1517 $choices = workflow_field_choices($form_state['values']['node']); 1518 drupal_set_message(t('Proyecto enviado a "#usuario".', array('#usuario' => $choices[$node->workflow]))); 1519 //drupal_set_message(t('Se modifico el estado del proyecto.')); 1290 1520 } 1291 1521 … … 1452 1682 $current = workflow_node_current_state($node); 1453 1683 // theme_workflow_current_state() must run state through check_plain(). 1454 drupal_set_title(t(' Cambiar el proyecto !proyecto del estado !estado', array('!proyecto' => $node->title, '!estado' =>$states[$current])));1684 drupal_set_title(t('El proyecto !proyecto se encuentra en el estado "!estado"', array('!proyecto' => $node->title, '!estado' =>$states[$current]))); 1455 1685 $output = '<p>'. t('Current state: !state', array('!state' => theme('workflow_current_state', $states[$current]))) . "</p>\n"; 1456 1686 unset($states[$current]); 1457 $output .= drupal_get_form('workflow_tab_form', $node, $wid, $states, $current); 1687 1688 1689 //$output .= '<div class="field-label"><b>' . t('Historico del Flujo de Trabajo') . ':</b> </div>'; 1690 $wid = workflow_get_workflow_for_type($node->type); 1691 $states_per_page = variable_get('workflow_states_per_page', 20); 1692 $result = db_query("SELECT sid, state FROM {workflow_states} WHERE status = 1 ORDER BY sid"); 1693 while ($data = db_fetch_object($result)) { 1694 $states[$data->sid] = check_plain(t($data->state)); 1695 } 1696 $deleted_states = array(); 1697 $result = db_query("SELECT sid, state FROM {workflow_states} WHERE status = 0 ORDER BY sid"); 1698 while ($data = db_fetch_object($result)) { 1699 $deleted_states[$data->sid] = check_plain(t($data->state)); 1700 } 1701 $current = workflow_node_current_state($node); 1702 // theme_workflow_current_state() must run state through check_plain(). 1703 //$output .= '<p>'. t('Current state: !state', array('!state' => theme('workflow_current_state', $states[$current]))) . "</p>\n"; 1704 $result = db_query("SELECT h.*, u.name FROM {workflow_node_history} h LEFT JOIN {users} u ON h.uid = u.uid WHERE nid = %d ORDER BY hid DESC", $node->nid); 1705 $rows = array(); 1706 while ($history = db_fetch_object($result)) { 1707 if ($history->sid == $current && !isset($deleted_states[$history->sid]) && !isset($current_themed)) { 1708 // Theme the current state differently so it stands out. 1709 $state_name = theme('workflow_current_state', $states[$history->sid]); 1710 // Make a note that we have themed the current state; other times in the history 1711 // of this node where the node was in this state do not need to be specially themed. 1712 $current_themed = TRUE; 1713 } 1714 elseif (isset($deleted_states[$history->sid])) { 1715 // The state has been deleted, but we include it in the history. 1716 $state_name = theme('workflow_deleted_state', $deleted_states[$history->sid]); 1717 $footer_needed = TRUE; 1718 } 1719 else { 1720 // Regular state. 1721 $state_name = check_plain(t($states[$history->sid])); 1722 } 1723 if (isset($deleted_states[$history->old_sid])) { 1724 $old_state_name = theme('workflow_deleted_state', $deleted_states[$history->old_sid]); 1725 $footer_needed = TRUE; 1726 } 1727 else { 1728 $old_state_name = check_plain(t($states[$history->old_sid])); 1729 } 1730 $rows[] = theme('workflow_history_table_row', $history, $old_state_name, $state_name); 1731 } 1732 $output .= theme('workflow_history_table', $rows, !empty($footer_needed)); 1733 1734 1735 1736 1737 //print_r($states); 1738 if (count($states)) { 1739 $output .= drupal_get_form('workflow_tab_form', $node, $wid, $states, $current); 1740 } 1741 else { 1742 drupal_set_title(t('El proyecto !proyecto se encuentra en el estado !estado', array('!proyecto' => $node->title, '!estado' =>$states[$current]))); 1743 } 1744 //echo "HOLA"; 1745 //$output .= drupal_get_form('workflow_tab_form', $node, $wid, $states, $current); 1458 1746 return $output; 1459 1747 } … … 1620 1908 $arreglo['ip']['situaciono'] = array( 1621 1909 'field_proyecto_so_descripcion' => 'field_proyecto_so_descripcion', 1622 'field_proyecto_so_cuantificacion' => 'field_proyecto_so_cuantificacion',1623 1910 'field_proyecto_tiempoi' => 'field_proyecto_tiempoi', 1624 1911 ); … … 1629 1916 $arreglo['ip']['resultadop'] = array( 1630 1917 'field_proyecto_descripcion_bien' => 'field_proyecto_descripcion_bien', 1918 'field_proyecto_so_cuantificacion' => 'field_proyecto_so_cuantificacion', 1631 1919 'field_proyecto_unidadm' => 'field_proyecto_unidadm', 1632 1920 'field_proyecto_meta_m' => 'field_proyecto_meta_m', … … 2022 2310 ); 2023 2311 2024 $arreglo['otros']['proyectos_operativos_flujo'] = t(' Flujo de Trabajo');2312 $arreglo['otros']['proyectos_operativos_flujo'] = t('Historico del Flujo de Trabajo'); 2025 2313 //Indicador del resultado del Proyecto 2026 2314 $form['otros']['fl'] = array( … … 2028 2316 '#options' => $arreglo['otros'], 2029 2317 '#default_value' => array(), 2030 '#title' => t(' Flujo de Trabajo'),2318 '#title' => t('Historico del Flujo de Trabajo'), 2031 2319 '#multiple' => TRUE, 2032 2320 '#weight' => 99, 2033 2321 ); 2034 $title_combos['fl']['title'] = t(' Flujo de Trabajo');2322 $title_combos['fl']['title'] = t('Historico del Flujo de Trabajo'); 2035 2323 $form['#title_combos'] = $title_combos; 2036 2324 //$campos['proyectos_operativos_flujo'] = t('Flujo de Trabajo'); … … 2177 2465 } 2178 2466 } 2179 } 2180 2467 } 2468 //mostrar por defecto el formulario de busqueda. 2469 unset($_SESSION['proyectos_operativos_mostrar_campos'][$node->nid]); 2181 2470 } 2182 2471 if (count($views)) { … … 2237 2526 } 2238 2527 if ($fecha && $ente->nid) { 2528 muestra_mensaje($tipo_plan, $ente_planificador, 0); 2529 } 2530 if ($fecha && (is_numeric($ente_planificador) && user_access('admin all planificador'))) { //usuarios administradores 2531 muestra_mensaje($tipo_plan, $ente_planificador, 0); 2532 } 2533 $rol_macro = variable_get('ActorPlanificadorMacro', 0); 2534 if ($fecha && in_array($rol_macro, array_keys($user->roles))) { //es usuario control 2239 2535 muestra_mensaje($tipo_plan, $ente_planificador, 0); 2240 2536 } … … 2396 2692 if (_proyectos_operativos_edita_datos_ae_access($node_accion)) { 2397 2693 $links['proyecto_ae_update'] = array( 2398 'data' => l(t('Agregar Acción EspecÃfica'), 'proyectosopedit/' . $proyecto->nid . '/ae'), 2694 'data' => l(t('Modificar las Acciones EspecÃficas'), 'proyectosopedit/' . $proyecto->nid . '/ae'), 2695 //'data' => l(t('Agregar Acción EspecÃfica'), 'proyectosopedit/' . $proyecto->nid . '/ae'), 2399 2696 'class' => 'proyectos-operativos-ae-modificar', 2400 2697 ); … … 2409 2706 if (_proyectos_operativos_edita_datos_wk_access($node_accion)) { 2410 2707 $links['proyecto_state'] = array( 2411 'data' => l(t(' Cambiar el estado'), 'proyectosop/' . $proyecto->nid . '/workflow'),2708 'data' => l(t('Revisión del Proyecto'), 'proyectosop/' . $proyecto->nid . '/workflow'), 2412 2709 'class' => 'proyectos-operativos-estado', 2413 2710 ); … … 3878 4175 $arreglo = array( 3879 4176 'field_proyecto_so_descripcion' => 'field_proyecto_so_descripcion', 3880 'field_proyecto_so_cuantificacion' => 'field_proyecto_so_cuantificacion',3881 4177 'field_proyecto_tiempoi' => 'field_proyecto_tiempoi', 3882 4178 ); … … 3912 4208 $arreglo = array(); 3913 4209 $arreglo['field_proyecto_descripcion_bien'] = 'field_proyecto_descripcion_bien'; 4210 $arreglo['field_proyecto_so_cuantificacion'] = 'field_proyecto_so_cuantificacion'; 3914 4211 $arreglo['field_proyecto_unidadm'] = 'field_proyecto_unidadm'; 3915 4212 $personas = variable_get('proyectos_operativos_allow_unidpersona', array()); … … 4024 4321 form_set_error('field_proyecto_meta_fisica', t('La Distribución de la Meta FisÃca del Proyecto debe tener al menos un resultado')); 4025 4322 } 4323 4324 if ($form_state['values']['field_proyecto_so_cuantificacion'][0]['value'] != $suma) { 4325 form_set_error('field_proyecto_so_cuantificacion', t('La cuantificación de la Meta del Proyectos debe ser igual a la Distribución de la Meta FisÃca')); 4326 } 4327 4328 4329 4026 4330 $personas = $form['#personas']; 4027 4331 if (count($personas) && isset($personas[$form_state['values']['field_proyecto_unidadm'][0]['value']])) { … … 4302 4606 } 4303 4607 $row = array(); 4304 $row[] = array('data' => '<b>' . t('TOTAL ') . '</b>', 'align' => 'right');4608 $row[] = array('data' => '<b>' . t('TOTAL DEL PROYECTO') . '</b>', 'align' => 'right'); 4305 4609 $suma = 0; 4306 4610 foreach($ftypes as $valor) { 4307 $row[] = array('data' => number_format($suma_mes[$valor], $format_number['decimals'], $format_number['dec_point'], $format_number['thousands_sep']), 'align' => 'center');4611 $row[] = array('data' => '<b>' . number_format($suma_mes[$valor], $format_number['decimals'], $format_number['dec_point'], $format_number['thousands_sep']) . '</b>', 'align' => 'center'); 4308 4612 $suma += $suma_mes[$valor]; 4309 4613 } 4310 4614 $style = ''; 4311 4615 if ($suma != $proyecto->field_proyecto_monto_anual[0]['value']) { 4312 $style = ' color: red';4313 } 4314 $row[] = array('data' => number_format($suma, $format_number['decimals'], $format_number['dec_point'], $format_number['thousands_sep']), 'align' => 'center', 'style' => $style);4616 $style = ''; 4617 } 4618 $row[] = array('data' => '<b>' . number_format($suma, $format_number['decimals'], $format_number['dec_point'], $format_number['thousands_sep']) . '</b>', 'align' => 'center', 'style' => $style); 4315 4619 $rows[] = $row; 4316 4620 } … … 4319 4623 $row[] = array('data' => t('No existen acciones especificas'), 'colspan' => 12, 'align' => 'center'); 4320 4624 } 4321 $output .= '<fieldset><legend>' . t('Resumen financiero de las acciones') . '</legend>' . '<div class="field-label"><b>' . t('Monto total para el año en curso:') . '</b> ' . number_format($proyecto->field_proyecto_monto_anual[0]['value'], $format_number['decimals'], $format_number['dec_point'], $format_number['thousands_sep']) . '</div>' . theme('table', array(), $rows) . '</fieldset>';4625 $output .= '<fieldset><legend>' . t('Resumen financiero de las acciones') . '</legend>' . '<div class="field-label"><b>' . t('Monto total del proyecto para el año en curso:') . '</b> ' . number_format($proyecto->field_proyecto_monto_anual[0]['value'], $format_number['decimals'], $format_number['dec_point'], $format_number['thousands_sep']) . '</div>' . theme('table', array(), $rows) . '</fieldset>'; 4322 4626 $rows = array(); 4323 4627 $row = array(); … … 4357 4661 } 4358 4662 $row = array(); 4359 $row[] = array('data' => '<b>' . t('TOTAL ') . '</b>', 'align' => 'right');4663 $row[] = array('data' => '<b>' . t('TOTAL DEL PROYECTO') . '</b>', 'align' => 'right'); 4360 4664 $suma = 0; 4361 4665 foreach($partidas as $valor) { 4362 $row[] = array('data' => number_format($suma_mes[$valor], $format_number['decimals'], $format_number['dec_point'], $format_number['thousands_sep']), 'align' => 'center');4666 $row[] = array('data' => '<b>' . number_format($suma_mes[$valor], $format_number['decimals'], $format_number['dec_point'], $format_number['thousands_sep']) . '</b>', 'align' => 'center'); 4363 4667 $suma += $suma_mes[$valor]; 4364 4668 } 4365 4669 $style = ''; 4366 4670 if ($suma != $proyecto->field_proyecto_monto_anual[0]['value']) { 4367 $style = ' color: red';4368 } 4369 $row[] = array('data' => number_format($suma, $format_number['decimals'], $format_number['dec_point'], $format_number['thousands_sep']), 'align' => 'center', 'style' => $style);4671 $style = ''; 4672 } 4673 $row[] = array('data' => '<b>' . number_format($suma, $format_number['decimals'], $format_number['dec_point'], $format_number['thousands_sep']) . '</b>', 'align' => 'center', 'style' => $style); 4370 4674 $rows[] = $row; 4371 4675 } … … 4374 4678 $row[] = array('data' => t('No existen acciones especificas'), 'colspan' => 12, 'align' => 'center'); 4375 4679 } 4376 $output .= '<fieldset><legend>' . t('Distribución por partida presupuestaria') . '</legend>' . '<div class="field-label"><b>' . t('Monto total para el año en curso:') . '</b> ' . number_format($proyecto->field_proyecto_monto_anual[0]['value'], $format_number['decimals'], $format_number['dec_point'], $format_number['thousands_sep']) . '</div>' . theme('table', array(), $rows) . '</fieldset>';4680 $output .= '<fieldset><legend>' . t('Distribución por partida presupuestaria') . '</legend>' . '<div class="field-label"><b>' . t('Monto total del proyecto para el año en curso:') . '</b> ' . number_format($proyecto->field_proyecto_monto_anual[0]['value'], $format_number['decimals'], $format_number['dec_point'], $format_number['thousands_sep']) . '</div>' . theme('table', array(), $rows) . '</fieldset>'; 4377 4681 $rows = array(); 4378 4682 $row = array(); … … 4404 4708 $row[] = array('data' => '<b>' . t('TOTAL FUENTES DE FINANCIAMIENTO') . ': </b>' . number_format($total_total, $format_number['decimals'], $format_number['dec_point'], $format_number['thousands_sep']), 'align' => 'center', 'colspan' => count($arreglo_financiamiento)); 4405 4709 $rows[] = $row; 4406 $output .= '<fieldset><legend>' . t('Fuentes de financiamiento') . '</legend>' . '<div class="field-label"><b>' . t('Monto total para el año en curso:') . '</b> ' . number_format($proyecto->field_proyecto_monto_anual[0]['value'], $format_number['decimals'], $format_number['dec_point'], $format_number['thousands_sep']) . '</div>' . theme('table', array(), $rows) . '</fieldset>'; 4407 if (_proyectos_operativos_access_editar($proyecto)) { 4710 $output .= '<fieldset><legend>' . t('Fuentes de financiamiento') . '</legend>' . '<div class="field-label"><b>' . t('Monto total del proyecto para el año en curso:') . '</b> ' . number_format($proyecto->field_proyecto_monto_anual[0]['value'], $format_number['decimals'], $format_number['dec_point'], $format_number['thousands_sep']) . '</div>' . theme('table', array(), $rows) . '</fieldset>'; 4711 // if (_proyectos_operativos_access_editar($proyecto)) { 4712 if (_proyectos_operativos_edita_datos_wk_access($proyecto)) { 4408 4713 $output .= _proyectos_operativos_proyecto_ver_workflow($proyecto); 4409 4714 } … … 4721 5026 $output .= drupal_render($form['field_proyecto_descripcion_bien']); 4722 5027 $output .= drupal_render($form['field_proyecto_unidadm']); 5028 $output .= drupal_render($form['field_proyecto_so_cuantificacion']); 4723 5029 if (isset($form['field_proyecto_meta_m']) && $form['field_proyecto_meta_f']) { 4724 5030 $output .= '<div id="meta-unidm-pers"><table id="unidm-persona" style="width:400px"><tr><th>' . $form['field_proyecto_meta_m']['#title'] . '</th><th>' . $form['field_proyecto_meta_f']['#title'] . '</th><th>' . t('Total') . '</th></tr><tr>';
Nota: Vea TracChangeset
para ayuda en el uso del visor de conjuntos de cambios.