Conjunto 518259e en sipes


Ignorar:
Fecha y hora:
07/07/2016 10:20:10 (hace 8 años)
Autor:
lhernandez <lhernandez@…>
Branches:
stable, version-3.0
Children:
5bee648
Parents:
15f3818
Mensaje:

se actualizo la funcion para calcular los beneficiarios

Fichero:
1 editado

Leyenda

No modificado
Añadido
Eliminado
  • 0.3-modules/proyectos_operativos/proyectos_operativos.module

    ra0cf94c r518259e  
    571571function _proyectos_operativos_access_editar($node) {
    572572  global $user;
    573   if (module_exists('workflow')) {
     573/*  if (module_exists('workflow')) {
    574574    $estado_aprobado = variable_get('proyectos_operativos_state_aprobado', NULL);
    575575    $estado_naprobado = variable_get('proyectos_operativos_state_naprobado', NULL);
     
    577577      return FALSE;
    578578    }
    579   }
     579  }*/
    580580  if ($node->anhoproyectos_operativos != variable_get('proyectos_operativos_anho_creacion', 0)) {
    581581    return FALSE;
     
    980980    'thousands_sep' => variable_get('proyectos_operativos_number_thousands_sep', '.'),
    981981  );
     982//  $sumas = array();
    982983  $cantidad++;
    983984  $texto_1_aux = $tipo == 'talento' ? 'talento-humano' : $tipo;
     
    10431044      foreach($arreglo as $field_id => $field) {
    10441045        //$field_id1 = 'edit-' . str_replace('_', '-', $field_id . '_' . $i);
    1045         $_POST[$field_id . '_' . $i] = str_replace('.', '', $_POST[$field_id . '_' . $i]);
     1046        $_POST[$field_id . '_' . $i] = str_replace($format_number['dec_point'], '', $_POST[$field_id . '_' . $i]);
    10461047        $valor = intval($_POST[$field_id . '_' . $i]) > 0 ? intval($_POST[$field_id . '_' . $i]) : 0;
    10471048        if ($field_id == 'field_proyecto_beneficiario') {
     
    11391140    $new_form['cantidad_' . $tipo] = $form[$tipo]['cantidad_' . $tipo];
    11401141    unset($new_form['cantidad_' . $tipo]['#suffix']);
    1141   unset($new_form['#prefix'], $new_form['#suffix']); // Prevent duplicate wrappers.
     1142    unset($new_form['#prefix'], $new_form['#suffix']); // Prevent duplicate wrappers.
    11421143  //unset($new_form['agrega_' . $tipo]);
    11431144  $output = drupal_render($new_form);
     1145
     1146  drupal_add_js($sumas, 'setting');
     1147  $output .= drupal_get_js();
     1148
    11441149  print drupal_to_js(array('data' => $output, 'status' => true));
    11451150  exit();
     
    19161921  $arreglo['ip']['resultadop'] = array(
    19171922    'field_proyecto_descripcion_bien' => 'field_proyecto_descripcion_bien',
    1918     'field_proyecto_so_cuantificacion' => 'field_proyecto_so_cuantificacion',
     1923    //'field_proyecto_so_cuantificacion' => 'field_proyecto_so_cuantificacion',
    19191924    'field_proyecto_unidadm' => 'field_proyecto_unidadm',
    19201925    'field_proyecto_meta_m' => 'field_proyecto_meta_m',
     
    23682373  $op = isset($form_state['values']['op']) ? $form_state['values']['op'] : '';
    23692374  if ($op == t('Volver a las opciones de campo')) {
    2370     unset($_SESSION['proyectos_operativos_mostrar_campos'][$form['#node']->nid]);
    23712375    $form_state['redirect'] = 'proyectosop/' . $form['#node']->nid;
    23722376    return;
     
    24662470      }
    24672471    }
    2468     //mostrar por defecto el formulario de busqueda.
    2469     unset($_SESSION['proyectos_operativos_mostrar_campos'][$node->nid]);
    24702472  }
    24712473  if (count($views)) {
     
    26902692      'class' => 'proyectos-operativos-modificar',
    26912693    );
    2692     if (_proyectos_operativos_edita_datos_ae_access($node_accion)) {
     2694    /*if (_proyectos_operativos_edita_datos_ae_access($node_accion)) {
    26932695      $links['proyecto_ae_update'] = array(
    26942696        'data' => l(t('Modificar las Acciones Específicas'), 'proyectosopedit/' . $proyecto->nid . '/ae'),
     
    26962698        'class' => 'proyectos-operativos-ae-modificar',
    26972699      );
    2698     }
     2700    }*/
    26992701    $links['proyecto_remove'] = array(
    27002702      'data' => l(t('Eliminar'), 'proyectosop/' . $proyecto->nid . '/remove'),
     
    27102712    );
    27112713  }
     2714  /*
    27122715  if (_proyectos_operativos_ver_datos_wk_access($node_accion)) {
    27132716    $links['proyecto_ae_view'] = array(
     
    27192722      'class' => 'proyectos-operativos-finacieros',
    27202723    );
    2721   }
     2724  }*/
    27222725}
    27232726
     
    33883391    'field_proyecto_sector' => 'field_proyecto_sector',
    33893392  );
     3393  $sumas['beneficiarios'] = array();
    33903394  $fields_form_dg_se = array();
    33913395  if (is_array($fields) && count($fields)) {
     
    34253429  }
    34263430  if (is_array($field_form) && count($field_form)) {
     3431    $sumas['beneficiarios']['empleos_generados'] = 'empleos_generados';
    34273432    module_load_include('inc', 'content', 'includes/content.node_form');
    34283433    foreach ($field_form as $field_id) {
     
    36153620    $totales = 0;
    36163621    $total_arreglo = array();
    3617     $sumas['beneficiarios'] = array();
    36183622    $vid = variable_get('proyectos_operativos_extra_bene', 0);
    36193623    //$terms = taxonomy_get_tree($vid);
     
    36893693    }
    36903694    $sumas['beneficiarios']['todosbeneficiarios'] = 'todosbeneficiarios';
    3691     $sumas['beneficiarios']['empleos_generados'] = 'empleos_generados';
    3692     drupal_add_js($sumas, 'setting');
    36933695    $form['#sumas'] = $sumas;
    36943696    $form['beneficiario'][$aux . '_' . $aui]['#suffix'] .= '<td align="center"><div class="todosbeneficiarios_total">' . $totales . '</div></td></tr>';
     
    37063708      ),
    37073709    );
     3710  }
     3711  if (count($sumas)) {
     3712    drupal_add_js($sumas, 'setting');
    37083713  }
    37093714  $field_form = array();
     
    42084213  $arreglo = array();
    42094214  $arreglo['field_proyecto_descripcion_bien'] = 'field_proyecto_descripcion_bien';
    4210   $arreglo['field_proyecto_so_cuantificacion'] = 'field_proyecto_so_cuantificacion';
     4215  //$arreglo['field_proyecto_so_cuantificacion'] = 'field_proyecto_so_cuantificacion';
    42114216  $arreglo['field_proyecto_unidadm'] = 'field_proyecto_unidadm';
    42124217  $personas = variable_get('proyectos_operativos_allow_unidpersona', array());
     
    43214326      form_set_error('field_proyecto_meta_fisica', t('La Distribución de la Meta Fisíca del Proyecto debe tener al menos un resultado'));
    43224327    }
    4323 
     4328/*
    43244329    if ($form_state['values']['field_proyecto_so_cuantificacion'][0]['value'] != $suma) {
    43254330      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'));
    43264331    }
    4327 
     4332*/
    43284333
    43294334
     
    50265031  $output .= drupal_render($form['field_proyecto_descripcion_bien']);
    50275032  $output .= drupal_render($form['field_proyecto_unidadm']);
    5028   $output .= drupal_render($form['field_proyecto_so_cuantificacion']);
     5033  //$output .= drupal_render($form['field_proyecto_so_cuantificacion']);
    50295034  if (isset($form['field_proyecto_meta_m']) && $form['field_proyecto_meta_f']) {
    50305035    $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.