Conjunto 96e211e en sipes
- Fecha y hora:
- 10/07/2017 15:22:33 (hace 7 años)
- Branches:
- stable
- Children:
- f9bf786
- Parents:
- 28143b8
- Fichero:
-
- 1 editado
Leyenda
- No modificado
- Añadido
- Eliminado
-
0.3-modules/ente_planificador_hierarchical/ente_planificador_hierarchical.module
r28143b8 r96e211e 194 194 $prev_father = intval($_POST['ente_planificador_hierarchical_father_' . $lower_level]) > 0 ? intval($_POST['ente_planificador_hierarchical_father_' . $lower_level]) : 0; 195 195 $childrens = _ente_planificador_hierarchical_get_children($prev_father, $lower_level); 196 if (isset($form['#node']->nid) && isset($childrens[$form['#node']->nid])) { 197 unset($childrens[$form['#node']->nid]); 198 } 199 $childrens[0] = t('Seleccionar este nivel'); 196 foreach ($childrens as $children) { 197 if ($children['nid']) { 198 $options[$children['nid']] = $children['title']; 199 } 200 } 201 if (isset($form['#node']->nid) && isset($options[$form['#node']->nid])) { 202 unset($options[$form['#node']->nid]); 203 } 204 $options[0] = t('Seleccionar este nivel'); 200 205 $form['ente_planificador_hierarchical_father_' . $i] = array( 201 206 '#title' => $tipo_text, 202 207 '#type' => 'select', 203 208 '#default_value' => $default_value, 204 '#options' => $ childrens,209 '#options' => $options, 205 210 ); 206 211 } … … 509 514 $prev_father = 0; 510 515 for($i = 1; $i < $hierarchical + 1; $i++) { 511 $ childrens = array();516 $options = array(); 512 517 $default_value = isset($fathers[$i])? $fathers[$i]['nid'] : 0; 513 518 $lower_level = $i - 1; … … 517 522 $query = db_query("SELECT d.nid, n.title FROM {ente_planificador} AS d INNER JOIN {node} AS n ON n.nid = d.nid WHERE tipo = 1"); 518 523 while ($father = db_fetch_object($query)) { 519 $ childrens[$father->nid] = $father->title;524 $options[$father->nid] = $father->title; 520 525 } 521 526 } … … 523 528 $tipo_text = t(variable_get('ente_planificador_hierarchical_text_' . $i, 'Actor operativo ' . $i)); 524 529 $childrens = _ente_planificador_hierarchical_get_children($prev_father, $lower_level); 525 } 526 if (isset($form['#node']->nid) && isset($childrens[$form['#node']->nid])) { 527 unset($childrens[$form['#node']->nid]); 530 foreach ($childrens as $children) { 531 if ($children['nid']) { 532 $options[$children['nid']] = $children['title']; 533 } 534 } 535 } 536 537 if (isset($form['#node']->nid) && isset($options[$form['#node']->nid])) { 538 unset($options[$form['#node']->nid]); 528 539 } 529 540 $macros = array(); 530 $macros = $ childrens;541 $macros = $options; 531 542 $macros[0] = t('Seleccionar este nivel'); 532 543 $opens_div .= '</div>';
Nota: Vea TracChangeset
para ayuda en el uso del visor de conjuntos de cambios.