source: sipes/0.3-modules/proyectos_operativos_mcti/accion_especifica_mcti.module @ c25d016

stableversion-3.0
Last change on this file since c25d016 was c25d016, checked in by lhernandez <lhernandez@…>, 8 años ago

se agregaron los nuevos cambios

  • Propiedad mode establecida a 100755
File size: 22.1 KB
Línea 
1<?php
2
3  /**
4  * Sistema Integral de Planificación y Presupuesto (SIPP)
5  * @file accion_especifica.module
6  * Drupal part Module to Sistema Integral de Planificación y Presupuesto (SIPP)
7  * Copyright 2013 Sistema Automatizado para la Planificación Estratégico-Situacional en la Administración Pública Venezolana (CENDITEL)
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
22  *
23  * @author Cenditel Merida - Msc. Juan Vizcarrondo
24  * @date 2013-02-02 // (a&#241;o-mes-dia)
25  * @version 0.1 // (0.1)
26  *
27  */
28
29
30/*
31 * Impletations of hook_form_alter()
32 */
33function accion_especifica_mcti_form_alter(&$form, $form_state, $form_id) {
34  if ($form_id == 'proyectos_operativos_admin_settings') {
35    $form['accion_especifica']['proyectos_operativos_muestra_proyecto_ubicacion_geografica'] = array(
36      '#type' => 'checkbox',
37      '#title' => t('Recolectar la ubicación geografica de la Accion Específica.'),
38      '#default_value' => variable_get('proyectos_operativos_muestra_proyecto_ubicacion_geografica', TRUE),
39      '#weight' => 0,
40    );
41  }
42  if ($form_id == 'proyectos_operativos_accion_especifica_crear_form') {
43    $node_type = content_types('accion_especifica');
44    $fields = $node_type['fields'];
45
46    $proyecto = $form['#proyecto'];
47    $ae_leido = $form['#node'];
48    $ejecucion = 0;
49    $montos = 0;
50    $porcentajes = array();
51    foreach($proyecto->field_proyecto_accion_esp as $accion) {
52      if ($accion['nid'] && $nid != $accion['nid']) {
53        $accion_load = node_load($accion['nid']);
54        if ($accion_load && $accion_load->type == 'accion_especifica') {
55          if ($accion_load->field_accion_esp_programacion[0]['tid']) {
56            foreach($accion_load->field_accion_esp_programacion as $programacion) {
57              foreach($programacion as $id_value => $mesp){
58                if ($id_value != 'tid') {
59                  $montos +=$mesp;
60                }
61              }
62            }
63          }
64          $acciones_especificas[$accion_load->nid] = $accion_load;
65          $porcentajes[$accion_load->field_accion_esp_ponderacion[0]['value']] = 1;
66          $ejecucion += $accion_load->field_accion_esp_ponderacion[0]['value'];
67        }
68      }
69      elseif($nid == $accion['nid']) {
70        $acciones_especificas[$ae->nid] = $ae;
71      }
72    }
73    $et = 100 - $ejecucion;
74    $form['#mensaje_mostrar'] =  t('Quedan @asignar% de ponderación en las Acciones Específicas.', array('@asignar' => $et));
75
76    //agregando el campo geo
77    if (variable_get('proyectos_operativos_muestra_proyecto_ubicacion_geografica', TRUE)) {
78      $arreglo = array(
79        'field_accion_esp_geo' => 'field_accion_esp_geo',
80      );
81      if (is_array($fields) && count($fields)) {
82        foreach ($fields as $field_id => $field) {
83          if (array_key_exists($field_id, $arreglo)) {
84            $field_form[] = $field_id;
85            $form['#proyectos_operativos_fields'][] = $field_id;
86          }
87          elseif (variable_get('proyectos_operativos_ac_muestra_geo_' . $field_id, FALSE)) {
88            $field_form[] = $field_id;
89            $form['#proyectos_operativos_fields'][] = $field_id;
90          }
91        }
92      }
93
94     if (is_array($field_form) && count($field_form)) {
95       module_load_include('inc', 'content', 'includes/content.node_form');
96       foreach ($field_form as $field_id) {
97         $field = content_fields($field_id, 'accion_especifica');
98         $form['#field_info'][$field_id] = $field;
99         $form += (array) content_field_form($form, $form_state, $field);
100       }
101     }
102   }
103   foreach ($form['#validate'] as $id => $name) {
104     if ($name == 'proyectos_operativos_accion_especifica_crear_form_validate') {
105       $form['#validate'][$id] = 'proyectos_operativos_mcti_accion_especifica_crear_form_validate';
106     }
107   }
108   $nuevo_submit = array();
109   foreach ($form['#submit'] as $id => $name) {
110     if ($name == 'proyectos_operativos_accion_especifica_crear_form_submit') {
111       $nuevo_submit[] = 'proyectos_operativos_mcti_accion_especifica_crear_form_submit';
112     }
113     $nuevo_submit[] = $name;
114   }
115   $form['#esplurianual'] = ($proyecto->field_proyecto_plurianual['value'] == 'SI') ? 1 : 0;
116   $form['#submit'] = $nuevo_submit;
117  }
118}
119
120/*
121 * Validar accion especifica
122 */
123function proyectos_operativos_mcti_accion_especifica_crear_form_validate($form, &$form_state) {
124  $op = isset($form_state['values']['op']) ? $form_state['values']['op'] : '';
125  if ($op == t('Cancelar') || $op == t('Terminar')) {
126    return;
127  }
128  $proyectos_operativos_path = drupal_get_path('module', 'proyectos_operativos');
129  drupal_add_js($proyectos_operativos_path . '/js/proyectos_operativos_extra.js');
130  drupal_add_js($proyectos_operativos_path . '/js/proyectos_operativos.js');
131  drupal_add_js($proyectos_operativos_path . '/js/accion_especifica.js');
132  drupal_add_js($form['#format_number'], 'setting');
133  drupal_add_js(array('accion_esp' => array('unidadmpers' => $form['#personas'])), 'setting');
134  //validamos que el porc sea mayor que cero
135  if (!$form_state['values']['field_accion_esp_ponderacion'][0]['value'] && $form_state['values']['field_accion_esp_ponderacion'][0]['value'] >= 100) {
136    form_set_error('field_accion_esp_ponderacion', t('La ponderaciones de la Acción especifica debe ser menor que 100'));
137  }
138
139  //validamos que el porc sea mayor que cero
140  if (!$form_state['values']['field_accion_esp_ponderacion'][0]['value'] && $form_state['values']['field_accion_esp_ponderacion'][0]['value'] <= 0) {
141    form_set_error('field_accion_esp_ponderacion', t('La ponderaciones de la Acción especifica debe ser mayor que cero'));
142  }
143  //validamos que la ponderacion no sea mayor a 100
144  $suma_porc = $form['#ejecucion'] + $form_state['values']['field_accion_esp_ponderacion'][0]['value'];
145  if ($suma_porc > 100) {
146    form_set_error('field_accion_esp_ponderacion', t('La suma de las ponderaciones de la Acción especifica debe ser menor o igual a 100%'));
147  }
148  // validamos que la cantidad de acciones permitidas cumpla con la minima permitida
149  if (variable_get('accion_especifica_100_ponderation', 0) && $form_state['values']['field_accion_esp_ponderacion'][0]['value'] >= 100) {
150    form_set_error('field_accion_esp_ponderacion', t('La ponderación de la Acción especifica debe ser menor o igual a 100%'));
151  }
152  //validamos que la ponderacion no se encuentre repetida
153  if (!variable_get('accion_especifica_allow_ponderation', 0) && isset($form['#porcentajes'][$form_state['values']['field_accion_esp_ponderacion'][0]['value']])) {
154    form_set_error('field_accion_esp_ponderacion', t('Ya existe una acción especifica con esta ponderación'));
155  }
156  //validamos que las fechas esten dentro de la del proyecto
157  if ($form_state['values']['field_accion_esp_fechai'][0]['value'] > $form_state['values']['field_accion_esp_fechai'][0]['value']) {
158    form_set_error('field_accion_esp_fechai', t('La fecha de inicio de la Acción especifica debe ser menor a la fecha de fin'));
159  }
160  if ($form['#proyecto']->field_proyecto_fecha_i[0]['value'] > $form_state['values']['field_accion_esp_fechai'][0]['value']) {
161    form_set_error('field_accion_esp_fechai', t('La fecha de inicio de la Acción especifica debe ser mayor o igual a la fecha de inicio del proyecto @fecha', array('@fecha' => $form['#proyecto']->field_proyecto_fecha_i[0]['value'])));
162  }
163  if ($form['#proyecto']->field_proyecto_fecha_f[0]['value'] < $form_state['values']['field_accion_esp_fechai'][0]['value']) {
164    form_set_error('field_accion_esp_fechai', t('La fecha de inicio de la Acción especifica debe ser mayor o igual a la fecha de fin del proyecto @fecha', array('@fecha' => $form['#proyecto']->field_proyecto_fecha_f[0]['value'])));
165  }
166  if ($form['#proyecto']->field_proyecto_fecha_i[0]['value'] > $form_state['values']['field_accion_esp_fechaf'][0]['value']) {
167    form_set_error('field_accion_esp_fechaf', t('La fecha de fin de la Acción especifica debe ser menor o igual a la fecha de inicio del proyecto @fecha', array('@fecha' => $form['#proyecto']->field_proyecto_fecha_i[0]['value'])));
168  }
169  if ($form['#proyecto']->field_proyecto_fecha_f[0]['value'] < $form_state['values']['field_accion_esp_fechaf'][0]['value']) {
170    form_set_error('field_accion_esp_fechaf', t('La fecha de fin de la Acción especifica debe ser menor o igual a la fecha de fin del proyecto @fecha', array('@fecha' => $form['#proyecto']->field_proyecto_fecha_f[0]['value'])));
171  }
172  //obtener la fecha de inicio y fin
173  $mes = explode('-', $form_state['values']['field_accion_esp_fechai'][0]['value']);
174  $mes_inicio = 0;
175  if (count($mes)) {
176    $mes_inicio = $mes[1] - 1;
177  }
178  //obtener la fecha de inicio y fin
179  $mes = explode('-', $form_state['values']['field_accion_esp_fechaf'][0]['value']);
180  $mes_final = 0;
181  if (count($mes)) {
182    $mes_final = $mes[1] - 1;
183  }
184  if (isset($form_state['values']['field_accion_esp_metaf'])) {
185    $suma = 0;
186    for ($i = 0; $i < 12; $i++) {
187      if ($mes_inicio <= $i && $mes_final >= $i) {
188        $valor = $i ? 'value_' . $i : 'value';
189        $suma += $form_state['values']['field_accion_esp_metaf'][0][$valor];
190      }
191    }
192    if (!$suma) {
193      form_set_error('field_accion_esp_metaf', t('La Distribución de la Meta Fisíca de la Acción especifica debe tener al menos un resultado'));
194    }
195    /*
196    $personas = $form['#personas'];
197    if (count($personas) && isset($personas[$form_state['values']['field_accion_esp_unidadm'][0]['value']])) {
198      $totalpersonas = $form_state['values']['field_accion_esp_meta_m'][0]['value'] + $form_state['values']['field_accion_esp_meta_f'][0]['value'];
199      if ($totalpersonas != $suma) {
200        form_set_error('field_accion_esp_meta_m', t('El total de Distribución de la Meta Fisíca de la Acción especifica debe ser igual a la cantidad de personas'));
201      }
202    }
203   */
204  }
205  //validamos la accion especifica
206  if (isset($form_state['values']['field_accion_esp_programacion']) && count($form_state['values']['field_accion_esp_programacion'])) {
207    $sumap = 0;
208    foreach($form_state['values']['field_accion_esp_programacion'] as $id_programacion => $programacion) {
209      if (is_numeric($id_programacion)) {
210        for ($i = 0; $i < 12; $i++) {
211          if ($mes_inicio <= $i && $mes_final >= $i) {
212            $valor = $i ? 'value_' . $i : 'value';
213            $sumap += (float) $programacion[$valor];
214          }
215        }
216      }
217    }
218    if (!$sumap) {
219      form_set_error('field_accion_esp_programacion', t('La Programación Financiera de la Acción especifica debe tener al menos un valor'));
220    }
221  }
222  $sumaf = 0;
223  //validamos el financiamiento
224  $first_field = FALSE;
225  if (count($form['#fields_financiamiento'])) {
226    foreach($form['#fields_financiamiento'] as $field_id) {
227      $start = (float) $form_state['values'][$field_id][0]['value'];
228      $start = number_format($start, $form['#format_number']['format_number']['decimals'], '.', '');
229      $value = preg_replace('@[^-0-9]@', '', $start);
230      if ($start && $start != $value) {
231        form_set_error($field_id, t('Solo números enteros son permitidos en la fuente de financiamiento.'));
232      }
233      if ($value < 0) {
234        form_set_error($field_id, t('Solo números positivos son permitidos en la fuente de financiamiento.'));
235      }
236      if (!$first_field) {
237        $first_field = $field_id;
238      }
239      if (isset($form_state['values'][$field_id][0]['value'])) {
240        $sumaf += $form_state['values'][$field_id][0]['value'];
241      }
242    }
243  }
244  if ($first_field && $sumaf > $sumap) {
245    form_set_error($first_field, t('Las fuentes de financiamiento (@f_financiamiento) deben ser menor o igual a la programación presupuestaria (@fuente)', array('@fuente' => number_format($sumap, $form['#format_number']['format_number']['decimals'], $form['#format_number']['format_number']['dec_point'], $form['#format_number']['format_number']['thousands_sep']), '@f_financiamiento' => number_format($sumaf, $form['#format_number']['format_number']['decimals'], $form['#format_number']['format_number']['dec_point'], $form['#format_number']['format_number']['thousands_sep']))));
246  }
247}
248
249/**
250 * Implementation of hook_theme_registry_alter().
251 */
252function accion_especifica_mcti_theme_registry_alter(&$theme_registry) {
253  if ($theme_registry['proyectos_operativos_accion_especifica_crear_form']) {   
254    $theme_registry['proyectos_operativos_accion_especifica_crear_form']['function'] = 'theme_proyectos_operativos_accion_especifica_mcti_crear_form';
255  }
256}
257
258/**
259 * tema a aplicar en el formulario proyectos_operativos_accion_especifica_crear_form
260 */
261function theme_proyectos_operativos_accion_especifica_mcti_crear_form($form) {
262  $output = '';
263  if (!$form['#proyecto_completed']) {
264    $output .= '<div id="mensaje-mostrar" class="mensaje mensaje-mostrar" style="color:red;font-weight: bold;">' . $form['#mensaje_mostrar'] . '</div>';
265    $output .= '<fieldset><legend>' . t('Definición de la Acción Especifica') . '</legend>' . drupal_render($form['field_accion_titulo']) . drupal_render($form['field_accion_esp_fechai']) . drupal_render($form['field_accion_esp_fechaf']);$output .= drupal_render($form['field_accion_esp_ejecutor']) . drupal_render($form['field_accion_esp_bien']) . '</fieldset>';
266    $output .= '<fieldset><legend>' . t('Distribución de la Meta Fisica de la acción Especifica') . '</legend>';
267    $output .= drupal_render($form['field_accion_esp_unidadm']);
268    if (isset($form['field_accion_esp_meta_m']) && $form['field_accion_esp_meta_f']) {
269      $output .= '<div id="meta-unidm-pers"><table id="unidm-persona" style="width:400px"><tr><th>' . $form['field_accion_esp_meta_m']['#title'] . '</th><th>' . $form['field_accion_esp_meta_f']['#title'] . '</th><th>' . t('Total') . '</th></tr><tr>';
270      $form['field_accion_esp_meta_m'][0]['value']['#title'] = '';
271      $form['field_accion_esp_meta_f'][0]['value']['#title'] = '';
272      $total = $form['field_accion_esp_meta_m'][0]['#value']['value'] + $form['field_accion_esp_meta_f'][0]['#value']['value'];
273      $output .= '<td>' . drupal_render($form['field_accion_esp_meta_m']) . '</td>';
274      $output .= '<td>' . drupal_render($form['field_accion_esp_meta_f']) . '</td>';
275      $output .= '<td style="width:100px; text-align: center"><div class="unidad_personas_total">' . number_format($total, $format_number['decimals'], $format_number['dec_point'], $format_number['thousands_sep']) . '</div></td></tr></table></div>';
276    }
277    $output .= drupal_render($form['field_accion_esp_ponderacion']);
278
279    $output .= '<span title="Este campo es obligatorio." class="form-required" style="margin-left: 180px; position: absolute;">*</span>' . drupal_render($form['field_accion_esp_metaf']);
280    $output .= '</fieldset>';
281    $output .= drupal_render($form['distribucion']);
282    $output .= '<fieldset><legend>' . t('Programación Financiera de la Acción') . '</legend>' . drupal_render($form['field_accion_esp_programacion']);
283    $ftypes = array(
284      'tid' => t('Account'),
285      'value' => t('Ene'),
286      'value_1' => t('Feb'),
287      'value_2' => t('Mar'),
288      'value_3' => t('Abr'),
289      'value_4' => t('May'),
290      'value_5' => t('Jun'),
291      'value_6' => t('Jul'),
292      'value_7' => t('Aug'),
293      'value_8' => t('Sep'),
294      'value_9' => t('Oct'),
295      'value_10' => t('Nov'),
296      'value_11' => t('Dic'),
297    );
298    $output .= '<div style="width:2250px">';
299    $i = -1;
300    foreach ($ftypes as $ftype => $label) {
301      if($ftype != 'tid') {
302        $output .= '<div class = "field_accion_esp_programacion_m' . $i . '_field_total field_accion_esp_programacion_totales" style = "width:143px;float:left;margin-left:10px; border: 1px solid #D5D5D5;text-align:center;overflow:auto">0</div>';
303      }
304      else {
305        $output .= '<div style = "width:180px;float:left;margin-left:5px;text-align:right"><b>' . t('TOTAL') . '</b></div>';
306      }
307      $i++;
308    }
309    $output .= '<div class = "field_accion_esp_programacion_dato_field_total" style = "width:143px;float:left;margin-left:10px; border: 1px solid #D5D5D5;text-align:center;overflow:auto">0</div>';
310    $output .= '</div></fieldset>';
311    $rows = array();
312    $row = array();
313    $row1 = array();
314    $cantidad_campos = count($form['#arreglo_financiamiento']);
315    if (is_array($form['#arreglo_financiamiento']) && count($form['#arreglo_financiamiento'])) {
316      foreach ($form['#arreglo_financiamiento'] as $id => $macro) {
317        $row[] = array('data' => drupal_render($form[$id]), );
318        $row1[] = array('data' => drupal_render($form['total_' . $id]), );
319      }
320      $rows[] = $row;
321      $rows[] = $row1;
322      $row = array();
323      $row[] = array('data' => '<b>' . t('TOTAL') . ':</b>', 'colspan' => $cantidad_campos - 1, 'align' => 'right');
324      $row[] = array('data' => drupal_render($form['total_financiamiento']), );
325      $rows[] = $row;
326      $output .= '<fieldset><legend>' . t('Fuentes de Financiamiento (BS)') . '<span title="Este campo es obligatorio." class="form-required">*</span></legend>' . theme('table', array(), $rows) . '</fieldset>';
327    }
328    $localizacion = variable_get('proyectos_operativos_muestra_accion_esp', TRUE);
329    if ($localizacion) {
330      $output .= '<fieldset><legend>' . t('Localización Geográfica') . '</legend>';
331      $output .= drupal_render($form['field_accion_esp_localizacion']) . drupal_render($form['field_accion_esp_latitud']) . drupal_render($form['field_accion_esp_longitud']);
332      $output .= '</fieldset>';
333      $output .= drupal_render($form);
334    }
335 
336    $geo = variable_get('proyectos_operativos_muestra_proyecto_ubicacion_geografica', TRUE);
337    if ($geo) {
338      $output .= '<fieldset><legend>' . t('Localización Geográfica de Ejecución') . '</legend>';
339      $output .= drupal_render($form['field_accion_esp_geo']);
340      $output .= '</fieldset>';
341    }
342    $output .= drupal_render($form);
343  }
344  $header = array();
345  $cab = 6;
346  $header[] = array('data' => t('Nro'));
347  $header[] = array('data' => t('Nombre'));
348  $header[] = array('data' => t('Fecha de inicio'));
349  $header[] = array('data' => t('Fecha de Fin')); 
350  $header[] = array('data' => t('%'));
351  $header[] = array('data' => t('Acción'));
352  $rows = array();
353  $i = 1;
354  if (count($form['#acciones_especificas'])) {
355    $suma = 0;
356    foreach ($form['#acciones_especificas'] as $accion) {
357      if (isset($accion->nid)) {
358        $row = array();
359        $row[] = array('data' => $i,);
360        $row[] = array('data' => $accion->titulo_asignado,);
361        //Se cambia el formato de la fecha
362        $fecha = explode(' ', $accion->field_accion_esp_fechai[0]['value']);
363        $formato = explode('-', $fecha[0]);
364        $row[] = array('data' => $formato[2] . '/' . $formato[1] . '/' . $formato[0],);
365        //Se cambia el formato de la fecha
366        $fecha = explode(' ', $accion->field_accion_esp_fechaf[0]['value']);
367        $formato = explode('-', $fecha[0]);
368        $row[] = array('data' => $formato[2] . '/' . $formato[1] . '/' . $formato[0],);
369        $suma += $accion->field_accion_esp_ponderacion[0]['value'];
370        $row[] = array('data' => $accion->field_accion_esp_ponderacion[0]['value'],);
371        $links = array();
372        $links[] = l(t('Modificar'), 'proyectosopedit/' . $form['#proyecto']->nid . '/ae/' . $accion->nid . '/edit');
373        $links[] = l(t('Eliminar'), 'proyectosopedit/' . $form['#proyecto']->nid . '/ae/' . $accion->nid . '/remove');
374        $row[] = array('data' => theme('item_list', $links),);
375        $rows[] = $row;
376        $i++;
377      }
378    }
379  }
380  if (count($rows)) {
381    $output .= theme('table', $header, $rows);
382  }
383  //no mostrar el formulario si ya se alcanzo lo asignado
384  if ($form['#proyecto_completed']) {
385    $output .= drupal_render($form);
386  }
387  return $output;
388}
389
390/**
391 * Agrega el valor total de la accion especifica al campo field_accion_total_financia
392 */
393function proyectos_operativos_mcti_accion_especifica_crear_form_submit($form, &$form_state) {
394  $op = isset($form_state['values']['op']) ? $form_state['values']['op'] : '';
395  $node_type = content_types('accion_especifica');
396  if ($op != t('Cancelar')) {
397/*
398    //validamos el financiamiento
399    $first_field = FALSE;
400    if (count($form['#fields_financiamiento'])) {
401      foreach ($form['#fields_financiamiento'] as $field_id) {
402        $start = (float) $form_state['values'][$field_id][0]['value'];
403        $start = number_format($start, $form['#format_number']['format_number']['decimals'], '.', '');
404        $value = preg_replace('@[^-0-9]@', '', $start);
405        if (!$first_field) {
406          $first_field = $field_id;
407        }
408        if (isset($form_state['values'][$field_id][0]['value'])) {
409          $sumaf += $form_state['values'][$field_id][0]['value'];
410        }
411      }
412    }
413*/
414    //obtener la fecha de inicio y fin
415    $mes = explode('-', $form_state['values']['field_accion_esp_fechai'][0]['value']);
416    $mes_inicio = 0;
417    if (count($mes)) {
418      $mes_inicio = $mes[1] - 1;
419    }
420    //obtener la fecha de inicio y fin
421    $mes = explode('-', $form_state['values']['field_accion_esp_fechaf'][0]['value']);
422    $mes_final = 0;
423    if (count($mes)) {
424      $mes_final = $mes[1] - 1;
425    }
426
427    $suma = 0;
428    if (isset($form_state['values']['field_accion_esp_programacion'])) {
429      foreach($form_state['values']['field_accion_esp_programacion'] as $id => $programacion) {
430        for ($i = 0; $i < 12; $i++) {
431          $valor = $i ? 'value_' . $i : 'value';
432          if ($mes_inicio <= $i && $mes_final >= $i) {
433            $suma += $form_state['values']['field_accion_esp_programacion'][$id][$valor];
434          }
435          else {
436            $form_state['values']['field_accion_esp_programacion'][$id][$valor] = 0;
437          }
438        }
439      }
440    }
441
442
443    $sumaT = $form['#montos'] + $suma;
444    $form['#proyecto']->field_proyecto_monto_anual[0]['value'] = $sumaT;
445    if (!$form['#esplurianual']) {
446      $form['#proyecto']->field_proyecto_total[0]['value'] = $sumaT;
447    }
448  }
449}
Nota: Vea TracBrowser para ayuda de uso del navegador del repositorio.