Conjunto 1b09bdc en sipp


Ignorar:
Fecha y hora:
26/06/2014 15:08:51 (hace 10 años)
Autor:
Luis Peña <lpena@…>
Branches:
master, drupal-7.x
Children:
ef46558
Parents:
d436359
Mensaje:

Modificaciones en las acciones centralizadas

Ubicación:
modules/acciones_centralizadas
Ficheros:
2 editados

Leyenda

No modificado
Añadido
Eliminado
  • modules/acciones_centralizadas/acciones_centralizadas.module

    r903b515 r1b09bdc  
    458458    $campo = acciones_centralizadas_menu_campo_load($campo);
    459459  }
     460$hay_campos = FALSE;
    460461  if (is_array($campo) && isset($campo['values']) && count($campo['values'])) {
    461462    foreach($campo['values'] as $partida) {
     463$hay_campos = TRUE;
    462464      $suma += $partida[$valor_texto];
    463465    }
    464466  }
    465   if (!$suma) {
     467 if (!$hay_campos) {
    466468    return FALSE;
    467469  }
     470
    468471  $roles_allow = variable_get('acciones_centralizadas_state_s_' . $seguimiento['estado'], array());
    469472  if ($user->uid == 1) {
     
    502505  $estado_aprobado = variable_get('acciones_centralizadas_state_aprobado', NULL);
    503506  $estado_naprobado = variable_get('acciones_centralizadas_state_naprobado', NULL);
     507
    504508  if ($reformulacion->estado == $estado_naprobado || $reformulacion->estado == $estado_aprobado) {
    505509    return FALSE;
    506510  }
     511
    507512  $states = _acciones_centralizadas_reformula_obtiene_estados();
    508513  $first_state = 0;
     
    11071112              $row[] = array('data' => number_format($min, $format_number['decimals'], $format_number['dec_point'], $format_number['thousands_sep']),);
    11081113              $row1[] = array('data' => $sing . number_format($valor, $format_number['decimals'], $format_number['dec_point'], $format_number['thousands_sep']),);
    1109               $totales_partidas_total += (float) $valor;
     1114             // $totales_partidas_total += (float) $valor;
    11101115              $row2[] = array('data' => number_format($min + $valor, $format_number['decimals'], $format_number['dec_point'], $format_number['thousands_sep']),);
    11111116            }
     
    11271132      if(count($rows)) {
    11281133        $row = array();
    1129 print_r($totales_partidas);
     1134
    11301135        $row[] = array('data' => '<b>' . t('TOTAL') . '</b>', 'align' => 'right', 'colspan' => $show_variacion ? 2 : 1);
    11311136        foreach($ftypes as $id_field => $texto) {
     
    15761581          $i = 1;
    15771582          foreach($ftypes as $id_field => $texto) {
    1578             $disabled = ($i < $mes)? TRUE : FALSE;
     1583            $disabled = FALSE;
     1584//          $disabled = ($i < $mes)? TRUE : FALSE;
    15791585            $total += $partida[$id_field];
    15801586            $varia = isset($variaciones[$id][$partida['tid']][$id_field]) ? $variaciones[$id][$partida['tid']][$id_field] : 0;
     
    15881594              '#type' => 'textfield',
    15891595              '#default_value' => $valor,
    1590               '#size' => 5,
     1596              '#size' => 15,
    15911597              '#disabled' => $disabled,
    15921598              '#attributes' => array('class' => $id . '_m' . ($i - 1) . 'p_' . $partida['tid'] . '_field ' . $id . '_' . $partida['tid'] . 'r ' . $id . '_m' . ($i - 1) . '_field ' . $id . '_dato_field numberref', 'onchange' => "valminimo('" . $idformuj . "', '" . $min . "');sumaref('" . $id . '_' . $partida['tid'] . 'r' . "');sumatexto('" . $id . '_m' . ($i - 1) . 'p_' . $partida['tid'] . '_field' . "');sumatexto('" . $id . '_m' . ($i - 1) . '_field' . "');sumatexto('" . $id . '_dato_field' . "');sumatoria_textos('" . $id .'p' . $partida['tid'] . '_field' . "');", 'valor' => $min, 'partida_campo' => $id . '_m' . ($i - 1) . 'p_' . $partida['tid'] . '_field'),
     
    15981604            '#type' => 'textfield',
    15991605            '#default_value' => $total1,
    1600             '#size' => 5,
     1606            '#size' => 15,
    16011607            '#disabled' => TRUE,
    16021608            '#attributes' => array('class' => $id . '_' . $partida['tid'] . 'r' . '_total totales'),
     
    16991705  $output .= drupal_render($form['group_ac_ac1']['field_ac_ac1_ae1']);
    17001706  unset($form['group_ac_ac1']);
    1701   $output .= '<div style="width:1250px">';
     1707  $output .= '<div style="width:2250px">';
    17021708  $i = -1;
    17031709  foreach ($ftypes as $ftype => $label) {
    17041710    if($ftype != 'tid') {
    1705       $output .= '<div class = "field_ac_ac1_ae1_m' . $i . '_field_total field_ac_ac1_ae1_totales" style = "width:60px;float:left;margin-left:18px; border: 1px solid #D5D5D5;text-align:center;overflow:auto">0</div>';
     1711      $output .= '<div class = "field_ac_ac1_ae1_m' . $i . '_field_total field_ac_ac1_ae1_totales" style = "width:140px;float:left;margin-left:13px; border: 1px solid #D5D5D5;text-align:center;overflow:auto">0</div>';
    17061712    }
    17071713    else {
    1708       $output .= '<div style = "width:170px;float:left;margin-left:5px;text-align:right"><b>' . t('TOTAL') . '</b></div>';
     1714      $output .= '<div style = "width:170px;float:left;margin-left:18px;text-align:right"><b>' . t('TOTAL') . '</b></div>';
    17091715    }
    17101716    $i++;
    17111717  }
    1712   $output .= '<div class = "field_ac_ac1_ae1_dato_field_total number1" style = "width:60px;float:left;margin-left:18px; border: 1px solid #D5D5D5;text-align:center;overflow:auto">5000</div>';
     1718  $output .= '<div class = "field_ac_ac1_ae1_dato_field_total number1" style = "width:140px;float:left;margin-left:13px; border: 1px solid #D5D5D5;text-align:center;overflow:auto">5000</div>';
    17131719  $output .= '</div></fieldset>';
    17141720  $form_aux['field_ac_ac2_ae2'] = $form['group_ac_ac2']['field_ac_ac2_ae2'];
     
    17161722  $output .= '<fieldset><legend>' . $form['group_ac_ac2']['#title'] . '</legend>';
    17171723  $output .= drupal_render($form['group_ac_ac2']['field_ac_ac1_ae2']);
    1718   $output .= '<div style="width:1250px">';
     1724  $output .= '<div style="width:2250px">';
    17191725  $i = -1;
    17201726  foreach ($ftypes as $ftype => $label) {
    17211727    if($ftype != 'tid') {
    1722       $output .= '<div class = "field_ac_ac1_ae2_m' . $i . '_field_total field_ac_ac1_ae2_totales" style = "width:60px;float:left;margin-left:18px; border: 1px solid #D5D5D5;text-align:center;overflow:auto">0</div>';
     1728      $output .= '<div class = "field_ac_ac1_ae2_m' . $i . '_field_total field_ac_ac1_ae2_totales" style = "width:140px;float:left;margin-left:13px; border: 1px solid #D5D5D5;text-align:center;overflow:auto">0</div>';
    17231729    }
    17241730    else {
    1725       $output .= '<div style = "width:170px;float:left;margin-left:5px;text-align:right"><b>' . t('TOTAL') . '</b></div>';
     1731      $output .= '<div style = "width:170px;float:left;margin-left:18px;text-align:right"><b>' . t('TOTAL') . '</b></div>';
    17261732    }
    17271733    $i++;
    17281734  }
    1729   $output .= '<div class = "field_ac_ac1_ae2_dato_field_total" style = "width:60px;float:left;margin-left:18px; border: 1px solid #D5D5D5;text-align:center;overflow:auto">0</div>';
     1735  $output .= '<div class = "field_ac_ac1_ae2_dato_field_total" style = "width:140px;float:left;margin-left:13px; border: 1px solid #D5D5D5;text-align:center;overflow:auto">0</div>';
    17301736  $output .= '</div>';
    17311737  $output .= '<div style="clear:both; height:30px"></div>';
    17321738  $output .= drupal_render($form['group_ac_ac2']['field_ac_ac2_ae2']);
    1733   $output .= '<div style="width:1250px">';
     1739  $output .= '<div style="width:2250px">';
    17341740  $i = -1;
    17351741  foreach ($ftypes as $ftype => $label) {
    17361742    if($ftype != 'tid') {
    1737       $output .= '<div class = "field_ac_ac2_ae2_m' . $i . '_field_total field_ac_ac2_ae2_totales" style = "width:60px;float:left;margin-left:18px; border: 1px solid #D5D5D5;text-align:center;overflow:auto">0</div>';
     1743      $output .= '<div class = "field_ac_ac2_ae2_m' . $i . '_field_total field_ac_ac2_ae2_totales" style = "width:140px;float:left;margin-left:13px; border: 1px solid #D5D5D5;text-align:center;overflow:auto">0</div>';
    17381744    }
    17391745    else {
    1740       $output .= '<div style = "width:170px;float:left;margin-left:5px;text-align:right"><b>' . t('TOTAL') . '</b></div>';
     1746      $output .= '<div style = "width:170px;float:left;margin-left:18px;text-align:right"><b>' . t('TOTAL') . '</b></div>';
    17411747    }
    17421748    $i++;
    17431749  }
    1744   $output .= '<div class = "field_ac_ac2_ae2_dato_field_total" style = "width:60px;float:left;margin-left:18px; border: 1px solid #D5D5D5;text-align:center;overflow:auto">0</div>';
     1750  $output .= '<div class = "field_ac_ac2_ae2_dato_field_total" style = "width:140px;float:left;margin-left:13px; border: 1px solid #D5D5D5;text-align:center;overflow:auto">0</div>';
    17451751  $output .= '</div>';
    17461752  $output .= '<div style="clear:both; height:30px"></div>';
    17471753  $output .= drupal_render($form['group_ac_ac2']['field_ac_ac2_ae3']);
    1748   $output .= '<div style="width:1250px">';
     1754  $output .= '<div style="width:2250px">';
    17491755  $i = -1;
    17501756  foreach ($ftypes as $ftype => $label) {
    17511757    if($ftype != 'tid') {
    1752       $output .= '<div class = "field_ac_ac2_ae3_m' . $i . '_field_total field_ac_ac2_ae3_totales" style = "width:60px;float:left;margin-left:18px; border: 1px solid #D5D5D5;text-align:center;overflow:auto">0</div>';
     1758      $output .= '<div class = "field_ac_ac2_ae3_m' . $i . '_field_total field_ac_ac2_ae3_totales" style = "width:140px;float:left;margin-left:13px; border: 1px solid #D5D5D5;text-align:center;overflow:auto">0</div>';
    17531759    }
    17541760    else {
    1755       $output .= '<div style = "width:170px;float:left;margin-left:5px;text-align:right"><b>' . t('TOTAL') . '</b></div>';
     1761      $output .= '<div style = "width:170px;float:left;margin-left:18px;text-align:right"><b>' . t('TOTAL') . '</b></div>';
    17561762    }
    17571763    $i++;
    17581764  }
    1759   $output .= '<div class = "field_ac_ac2_ae3_dato_field_total" style = "width:60px;float:left;margin-left:18px; border: 1px solid #D5D5D5;text-align:center;overflow:auto">0</div>';
     1765  $output .= '<div class = "field_ac_ac2_ae3_dato_field_total" style = "width:140px;float:left;margin-left:13px; border: 1px solid #D5D5D5;text-align:center;overflow:auto">0</div>';
    17601766  unset($form['group_ac_ac2']);
    17611767  $output .= '</div></fieldset>';
     
    17631769  $output .= drupal_render($form['group_ac_ac3']['field_ac_ac3_ae1']);
    17641770  unset($form['group_ac_ac3']);
    1765   $output .= '<div style="width:1250px">';
     1771  $output .= '<div style="width:2250px">';
    17661772  $i = -1;
    17671773  foreach ($ftypes as $ftype => $label) {
    17681774    if($ftype != 'tid') {
    1769       $output .= '<div class = "field_ac_ac3_ae1_m' . $i . '_field_total field_ac_ac3_ae1_totales" style = "width:60px;float:left;margin-left:18px; border: 1px solid #D5D5D5;text-align:center;overflow:auto">0</div>';
     1775      $output .= '<div class = "field_ac_ac3_ae1_m' . $i . '_field_total field_ac_ac3_ae1_totales" style = "width:140px;float:left;margin-left:13px; border: 1px solid #D5D5D5;text-align:center;overflow:auto">0</div>';
    17701776    }
    17711777    else {
    1772       $output .= '<div style = "width:170px;float:left;margin-left:5px;text-align:right"><b>' . t('TOTAL') . '</b></div>';
     1778      $output .= '<div style = "width:170px;float:left;margin-left:18px;text-align:right"><b>' . t('TOTAL') . '</b></div>';
    17731779    }
    17741780    $i++;
    17751781  }
    1776   $output .= '<div class = "field_ac_ac3_ae1_dato_field_total" style = "width:60px;float:left;margin-left:18px; border: 1px solid #D5D5D5;text-align:center;overflow:auto">0</div>';
     1782  $output .= '<div class = "field_ac_ac3_ae1_dato_field_total" style = "width:140px;float:left;margin-left:13px; border: 1px solid #D5D5D5;text-align:center;overflow:auto">0</div>';
    17771783  $output .= '</div></fieldset>';
    17781784  $output .= '<fieldset><legend>' . $form['group_ac_ac4']['#title'] . '</legend>';
    17791785  $output .= drupal_render($form['group_ac_ac4']['field_ac_ac4_ae1']);
    17801786unset($form['group_ac_ac4']);
    1781   $output .= '<div style="width:1250px">';
     1787  $output .= '<div style="width:2250px">';
    17821788  $i = -1;
    17831789  foreach ($ftypes as $ftype => $label) {
    17841790    if($ftype != 'tid') {
    1785       $output .= '<div class = "field_ac_ac4_ae1_m' . $i . '_field_total field_ac_ac4_ae1_totales" style = "width:60px;float:left;margin-left:18px; border: 1px solid #D5D5D5;text-align:center;overflow:auto">0</div>';
     1791      $output .= '<div class = "field_ac_ac4_ae1_m' . $i . '_field_total field_ac_ac4_ae1_totales" style = "width:140px;float:left;margin-left:13px; border: 1px solid #D5D5D5;text-align:center;overflow:auto">0</div>';
    17861792    }
    17871793    else {
    1788       $output .= '<div style = "width:170px;float:left;margin-left:5px;text-align:right"><b>' . t('TOTAL') . '</b></div>';
     1794      $output .= '<div style = "width:170px;float:left;margin-left:18px;text-align:right"><b>' . t('TOTAL') . '</b></div>';
    17891795    }
    17901796    $i++;
    17911797  }
    1792   $output .= '<div class = "field_ac_ac4_ae1_dato_field_total" style = "width:60px;float:left;margin-left:18px; border: 1px solid #D5D5D5;text-align:center;overflow:auto">0</div>';
     1798  $output .= '<div class = "field_ac_ac4_ae1_dato_field_total" style = "width:140px;float:left;margin-left:13px; border: 1px solid #D5D5D5;text-align:center;overflow:auto">0</div>';
    17931799  $output .= '</div></fieldset>';
    17941800  $output .= drupal_render($form['field_acciones_ente']);
     
    18621868          $row1[] = array('data' => drupal_render($form[$id_field . '_' . $field['tid'] . 'r_' . $id]),);
    18631869          $total2 += $min + $value_box;
    1864           $row2[] = array('data' => '<div class = "' . $id_field . '_m' . $i . 'p_' . $field['tid'] . '_field_total ' . $id_field . '_totales ' . $id_field . 'p' . $field['tid'] . '_field_totalesR' . '" style = "width:60px;float:left;margin-left:1px; border: 1px solid #D5D5D5;text-align:center;overflow:auto">' . number_format($min + $value_box, $form['#format_number']['format_number']['decimals'], $form['#format_number']['format_number']['dec_point'], $form['#format_number']['format_number']['thousands_sep']) . '</div>',);
     1870          $row2[] = array('data' => '<div class = "' . $id_field . '_m' . $i . 'p_' . $field['tid'] . '_field_total ' . $id_field . '_totales ' . $id_field . 'p' . $field['tid'] . '_field_totalesR' . '" style = "width:140px;float:left;margin-left:1px; border: 1px solid #D5D5D5;text-align:center;overflow:auto">' . number_format($min + $value_box, $form['#format_number']['format_number']['decimals'], $form['#format_number']['format_number']['dec_point'], $form['#format_number']['format_number']['thousands_sep']) . '</div>',);
    18651871          $i++;
    18661872        }
    18671873        $row[] = array('data' => number_format($total, $form['#format_number']['format_number']['decimals'], $form['#format_number']['format_number']['dec_point'], $form['#format_number']['format_number']['thousands_sep']),);
    18681874        $row1[] = array('data' => drupal_render($form[$id_field . '_' . $field['tid'] . 'r_total']),);
    1869         $row2[] = array('data' => '<div class = "' . $id_field . 'p_' . $field['tid'] . '_dato_field_total ' . $id_field . 'p' . $field['tid'] . '_field_dato_field_total' . '" style = "width:60px;float:left;margin-left:1px; border: 1px solid #D5D5D5;text-align:center;overflow:auto">' . number_format($total2, $form['#format_number']['format_number']['decimals'], $form['#format_number']['format_number']['dec_point'], $form['#format_number']['format_number']['thousands_sep']) . '</div>',);
     1875        $row2[] = array('data' => '<div class = "' . $id_field . 'p_' . $field['tid'] . '_dato_field_total ' . $id_field . 'p' . $field['tid'] . '_field_dato_field_total' . '" style = "width:140px;float:left;margin-left:1px; border: 1px solid #D5D5D5;text-align:center;overflow:auto">' . number_format($total2, $form['#format_number']['format_number']['decimals'], $form['#format_number']['format_number']['dec_point'], $form['#format_number']['format_number']['thousands_sep']) . '</div>',);
    18701876        $rows[] = $row;
    18711877        $rows[] = $row1;
     
    18821888        foreach($ftypes as $id =>$texto) {
    18831889           $suma_partida += $totales_partidas[$id_field][$id];
    1884            $row[] = array('data' => '<div class = "' . $id_field . '_m' . $i . '_field_total ' . $id_field . '_totales ' . $id_field . '_totalesR" style = "width:60px;float:left;margin-left:1px; border: 1px solid #D5D5D5;text-align:center;overflow:auto">' . number_format($totales_partidas[$id_field][$id], $form['#format_number']['format_number']['decimals'], $form['#format_number']['format_number']['dec_point'], $form['#format_number']['format_number']['thousands_sep']) . '</div>',);
     1890           $row[] = array('data' => '<div class = "' . $id_field . '_m' . $i . '_field_total ' . $id_field . '_totales ' . $id_field . '_totalesR" style = "width:140px;float:left;margin-left:1px; border: 1px solid #D5D5D5;text-align:center;overflow:auto">' . number_format($totales_partidas[$id_field][$id], $form['#format_number']['format_number']['decimals'], $form['#format_number']['format_number']['dec_point'], $form['#format_number']['format_number']['thousands_sep']) . '</div>',);
    18851891           $i++;
    18861892        }
    1887         $row[] = array('data' => '<div class = "' . $id_field . '_dato_field_total" style = "width:60px;float:left;margin-left:1px; border: 1px solid #D5D5D5;text-align:center;overflow:auto">' . number_format($suma_partida, $form['#format_number']['format_number']['decimals'], $form['#format_number']['format_number']['dec_point'], $form['#format_number']['format_number']['thousands_sep']) . '</div>',);
     1893        $row[] = array('data' => '<div class = "' . $id_field . '_dato_field_total" style = "width:140px;float:left;margin-left:1px; border: 1px solid #D5D5D5;text-align:center;overflow:auto">' . number_format($suma_partida, $form['#format_number']['format_number']['decimals'], $form['#format_number']['format_number']['dec_point'], $form['#format_number']['format_number']['thousands_sep']) . '</div>',);
    18881894        $rows[] = $row;
    18891895      }
     
    19451951      $i = 1;
    19461952      foreach($ftypes as $ids =>$texto) {
    1947         $disabled = ($i >= $form['#mes'])? TRUE : FALSE;
     1953        $disabled = TRUE;
     1954//        $disabled = ($i >= $form['#mes'])? TRUE : FALSE;
    19481955        if ($disabled) {
    19491956          $start = $form_state['values'][$id . '_' . $partida['tid'] .'r_' . $ids];
     
    19761983        if ($existe) {
    19771984          form_set_error($id . '][' . $idf . '][tid', t('La nueva partida ya se encuentra en la planificación'));
     1985        }
     1986      }
     1987      else {
     1988        foreach($ftypes as $ids =>$texto) {
     1989          if ($partida[$ids] && is_numeric($partida[$ids])) {
     1990            $valida_valor = TRUE;
     1991          }
    19781992        }
    19791993      }
     
    20202034      $i = 1;
    20212035      foreach($ftypes as $ids =>$texto) {
    2022         $disabled = ($i >= $form['#mes'])? TRUE : FALSE;
     2036        $disabled = TRUE;
     2037//        $disabled = ($i >= $form['#mes'])? TRUE : FALSE;
    20232038        $reformula = isset($form['#reformula'][$id][$partida['tid']][$ids]) ? $form['#reformula'][$id][$partida['tid']][$ids] : 0;
    20242039        $total = $disabled ? $form_state['values'][$id . '_' . $partida['tid'] .'r_' . $ids] : $reformula;
     
    27492764  $output .= '</table>';
    27502765  $links = array();
    2751   if ($fecha && $current_estado != $estado_aprobado && $current_estado != $estado_naprobado &&  $acceso && $suma > 0) {
     2766  if ($fecha && $current_estado != $estado_aprobado && $current_estado != $estado_naprobado &&  $acceso) {
    27522767    $links[] = l(t('Modificar seguimiento'), 'node/' . $node->nid . '/seguimiento/' . $campo['field'] . '/' . $mes . '/edit');
    27532768  }
     
    30103025      $suma += $valor;
    30113026      $zonacritica = $valor ? $causadov/$valor : -1;
    3012       $porczonacritica = $zonacritica >= 0 ? ($zonacritica * 100) . '%' : -1;
     3027      $porczonacritica = $zonacritica >= 0 ? number_format(($zonacritica * 100), $form['#format_number']['format_number']['decimals'], $form['#format_number']['format_number']['dec_point'], $form['#format_number']['format_number']['thousands_sep']) . '%' : -1;
    30133028      $form[$partida['tid'] . '_asignado'] = array(
    30143029        '#type' => 'textfield',
     
    30183033      );
    30193034      $disabled = $valor == 0 ? TRUE : FALSE;
     3035$disabled = FALSE;
    30203036      $form[$partida['tid'] . '_comprometido'] = array(
    30213037        '#type' => 'textfield',
     
    38393855  $mensaje = '';
    38403856  if ($mes != $mes_segu -1 || $node->anhoaccion_centralizada != $year) {
    3841     $mensaje = '<div class ="nota-complementaria"><b>' . t('Nota complementaria') . ':</b> ' . t('Mes fuera del período de duración de la acción específica.') . '</div>';
    3842   }
    3843   $mensaje .= t('Para consultar las partidas de esta Acción especifica en el mes actual ir a ');
     3857    $mensaje = '<div class ="nota-complementaria"><b>' . t('Nota complementaria') . ':</b> ' . t('Mes fuera del período de duración de la acción centralizada.') . '</div>';
     3858  }
     3859  $mensaje .= t('Para consultar las partidas de esta Acción Centralizada en el mes actual ir a ');
    38443860  foreach($grupos as $id => $grupo) {
    38453861    $tablas = array();
     
    38663882        $estado = isset($states['states'][$current_estado]) ? $states['states'][$current_estado] : t('No ingresado');
    38673883        $row[] = array('data' => $mes_texto, 'align' => 'center',);
    3868         $etiquetas = isset($states['states'][$current_estado]) ? '<div class="semaforo semaforo-' . $current_estado . '">•</div>' : '-';
     3884        $etiquetas = isset($states['states'][$current_estado]) ? '<div class="semaforo semaforo' . $current_estado . '">•</div>' : '-';
    38693885        $row[] = array('data' => $etiquetas, 'align' => 'center',);
    38703886        $row[] = array('data' => $estado, 'align' => 'center',);
     
    38723888        $transitions = array();
    38733889        $texto_value = $mes == 0 ? 'value' : 'value_' . $mes;
    3874         if ($suma[$texto_value] && _acciones_centralizadas_seguimiento_node_tab_mes_access($node, $id_field, $mes)) {
     3890        if (_acciones_centralizadas_seguimiento_node_tab_mes_access($node, $id_field, $mes)) {
    38753891           $links[] = l(t('Modificar seguimiento'), 'node/' . $node->nid . '/seguimiento/' . $id_field . '/' . $mes . '/edit', array('query' => array('destination' => $_GET['q'])));
    38763892        }
     
    38873903        $rows[] = $row;
    38883904     
    3889         $tablas[]= '<div class="field-label">' . $field_load['widget']['label'] . '</div>' . theme('table', $header, $rows) . $mensaje . l(t('Seguimiento de la Acción Específica'), 'node/' . $node->nid . '/seguimiento/' . $id_field . '/' . $mes . '/view') . '<br>';
     3905        $tablas[]= '<div class="field-label">' . $field_load['widget']['label'] . '</div>' . theme('table', $header, $rows) . $mensaje . l(t('Seguimiento de la Acción Centralizada'), 'node/' . $node->nid . '/seguimiento/' . $id_field . '/' . $mes . '/view') . '<br>';
    38903906      }
    38913907    }
  • modules/acciones_centralizadas/js/acciones_centralizadas.js

    r903b515 r1b09bdc  
    135135    }
    136136  });
    137 /*
     137
    138138  sumatexto('field_ac_ac1_ae1_dato_field');
    139139  sumatexto('field_ac_ac1_ae2_dato_field');
     
    142142  sumatexto('field_ac_ac3_ae1_dato_field');
    143143  sumatexto('field_ac_ac4_ae1_dato_field');
    144 */
     144
    145145  for (i = 0; i < 12;i++) {
    146146    sumatexto('field_ac_ac1_ae1_m' + i + '_field');
     
    151151    sumatexto('field_ac_ac4_ae1_m' + i + '_field');
    152152  }
     153
    153154  sumatoria_textos('field_ac_ac1_ae1');
    154155  sumatoria_textos('field_ac_ac1_ae2');
     
    157158  sumatoria_textos('field_ac_ac3_ae1');
    158159  sumatoria_textos('field_ac_ac4_ae1');
     160
    159161  $("#node-form, #acciones-centralizadas-reformula-tab-page-form, #acciones-centralizadas-seguimiento-tab-page-form").submit(function( event ) {
    160162    $(".number, .numberref").each(function() {
     
    217219  }
    218220  else {
     221/*
    219222    $('#edit-' + partida + '-porcen').val('N/A');
    220223    var estilo = $('#' + partida + '-inversion-form'). attr('style');
    221224    estilo += ';background:' + Drupal.settings.acciones_centralizadas[0]['color'] + ';color:' + Drupal.settings.acciones_centralizadas[0]['tcolor'];
    222225    $('#' + partida + '-inversion-form'). attr('style', estilo);
     226*/
     227    if (causado > 0) {
     228      $('#' + partida + '-inversion-form').html(Drupal.settings.acciones_centralizadas[5]['texto']);
     229      $('#edit-' + partida + '-porcen').val('N/D');
     230      var estilo = $('#' + partida + '-inversion-form'). attr('style');
     231      estilo += ';background:' + Drupal.settings.acciones_centralizadas[5]['color'] + ';color:' + Drupal.settings.acciones_centralizadas[5]['tcolor'];
     232      $('#' + partida + '-inversion-form'). attr('style', estilo);
     233    }
     234    else {
     235      $('#edit-' + partida + '-porcen').val('N/A');
     236      var estilo = $('#' + partida + '-inversion-form'). attr('style');
     237      estilo += ';background:' + Drupal.settings.acciones_centralizadas[0]['color'] + ';color:' + Drupal.settings.acciones_centralizadas[0]['tcolor'];
     238      $('#' + partida + '-inversion-form'). attr('style', estilo);
     239    }
    223240  }
    224241}
     
    275292  var valor = 0;
    276293  var valores = 0;
     294  var entra = false;
    277295  $('.' + clase + '_totalesR').each(function() {
     296    entra = true;
    278297    valor = parseFloat($(this).html().replace(/[Drupal.settings.format_number.thousands_sep\s]/g, '').replace(/[Drupal.settings.format_number.dec_point\s]/g, '.'));
    279298    if (isNaN(valor) || !isFinite(valor)) {
     
    289308  });
    290309  if (sum == 0){sum = '0';}
    291   $('.' + clase + '_dato_field_total').html($.number(sum, Drupal.settings.format_number.decimals, Drupal.settings.format_number.dec_point, Drupal.settings.format_number.thousands_sep));
    292 }
     310  if (entra == true) {
     311    $('.' + clase + '_dato_field_total').html($.number(sum, Drupal.settings.format_number.decimals, Drupal.settings.format_number.dec_point, Drupal.settings.format_number.thousands_sep));
     312  }
     313}
Nota: Vea TracChangeset para ayuda en el uso del visor de conjuntos de cambios.