Conjunto 28143b8 en sipes
- Fecha y hora:
- 06/07/2017 15:56:29 (hace 7 años)
- Branches:
- stable
- Children:
- 96e211e
- Parents:
- 34e3034
- Fichero:
-
- 1 editado
Leyenda
- No modificado
- Añadido
- Eliminado
-
0.3-modules/ente_planificador_hierarchical/ente_planificador_hierarchical.module
r9ffeea7 r28143b8 247 247 $node->ente_planificador_hierarchical = array( 248 248 'fathers' => _ente_planificador_hierarchical_get_desc($node->nid, 1), 249 'children' => _ente_planificador_hierarchical_get_ desc($node->nid, 0),249 'children' => _ente_planificador_hierarchical_get_children($node->nid, $node->tipo), 250 250 ); 251 251 $hierarchical = variable_get('ente_planificador_hierarchical_count', 2); … … 255 255 } 256 256 } 257 258 257 break; 259 258 case 'presave': … … 319 318 $fathers = ''; 320 319 $sep = ''; 321 foreach($node->ente_planificador_hierarchical['children'] as $ level=> $ente) {322 $fathers .= $sep . l($ente['title'], 'node/'. $ ente['nid']);323 $sep = ' >';320 foreach($node->ente_planificador_hierarchical['children'] as $nid => $ente) { 321 $fathers .= $sep . l($ente['title'], 'node/'. $nid); 322 $sep = ' | '; 324 323 } 325 324 $node->content['ente_planificador_hierarchical_childrens'] = array( … … 333 332 } 334 333 } 335 336 337 334 /** 335 * 336 */ 338 337 function ente_planificador_hierarchical_obtiene_tipos_alter(&$tipos) { 339 338 $hierarchical = variable_get('ente_planificador_hierarchical_count', 2); 340 for ($i = 1; $i < $hierarchical + 1; $i++) {339 for ($i = 1; $i < $hierarchical + 1; $i++) { 341 340 if ($i == 1) { 342 341 $tipos[$i] = t(variable_get('ente_planificador_hierarchical_text_' . $i, 'Actor estratégico-táctico')); … … 356 355 if ($wid){ 357 356 $states = workflow_get_states($wid); 358 359 357 $form['buttons']['#weight'] = 1000; 360 358 if (count($states)) { … … 366 364 ); 367 365 $hierarchical = variable_get('ente_planificador_hierarchical_count', 2); 368 for ($i = 1; $i < $hierarchical + 1; $i++) {366 for ($i = 1; $i < $hierarchical + 1; $i++) { 369 367 $form['workflow_formuladores']['proyectos_operativos_state_form_' . $i] = array( 370 368 '#type' => 'select', … … 374 372 '#multiple' => FALSE, 375 373 ); 376 377 378 374 } 379 375 } … … 386 382 $ente_planificador = ente_planificador_leer_ente_planificadores($form['node']['#value']->field_proyecto_ente[0]['nid']); 387 383 $hierarchical = variable_get('ente_planificador_hierarchical_count', 2); 388 for($i = 1; $i < $hierarchical + 1; $i++) { 389 //print_r($ente_planificador); 384 for ($i = 1; $i < $hierarchical + 1; $i++) { 390 385 if ($ente_planificador->tipo != $i) { 391 386 $estado = variable_get('proyectos_operativos_state_form_' . $i, 0); … … 595 590 } 596 591 597 function _ente_planificador_hierarchical_get_desc($nid, $ father = 1, $level = 0) {592 function _ente_planificador_hierarchical_get_desc($nid, $get_father = 1, $level = 0) { 598 593 $fathers = array(); 599 594 //get fathers 600 if ($ father) {595 if ($get_father) { 601 596 $sql = 'SELECT father.father as nid, father.level, n.title FROM {ente_planificador_hierarchical} AS father INNER JOIN {node} AS n ON n.nid = father.father WHERE father.nid = %d'; 602 597 } … … 614 609 $query = db_query($sql, $inputs); 615 610 while ($father = db_fetch_object($query)) { 616 $fathers[$father->level] = array( 617 'title' => $father->title, 618 'nid' => $father->nid, 619 ); 611 if ($get_father) { 612 $fathers[$father->level] = array( 613 'title' => $father->title, 614 'nid' => $father->nid, 615 'level' => $father->level, 616 ); 617 } 618 else { 619 $fathers[$father->nid] = array( 620 'title' => $father->title, 621 'nid' => $father->nid, 622 'level' => $father->level, 623 ); 624 } 620 625 } 621 626 return $fathers; … … 657 662 $query = db_query($sql, $inputs); 658 663 while ($father = db_fetch_object($query)) { 659 $fathers[$father->nid] = $father->title; 664 $fathers[$father->nid] = array( 665 'title' => $father->title, 666 'nid' => $father->nid, 667 'level' => $father->level + 1, 668 ); 660 669 } 661 670 return $fathers; … … 720 729 ); 721 730 } 731 732 /** 733 * Implementation of hook_obtiene_macro_alter() 734 */ 735 function ente_planificador_hierarchical_obtiene_macro_alter(&$actor_macr0, $ente_planificador) { 736 if (count($ente_planificador->ente_planificador_hierarchical['children'])) { 737 if ($ente_planificador->tipo <= variable_get('situacion_actual_preliminar_hierarchical_count', 2)) { 738 $actor_macr0 = $ente_planificador->nid; 739 } 740 } 741 else if (count($ente_planificador->ente_planificador_hierarchical['fathers'])) { 742 $pos = variable_get('situacion_actual_preliminar_hierarchical_count', 2); 743 $actor_macr0 = $ente_planificador->ente_planificador_hierarchical['fathers'][$pos]; 744 } 745 }
Nota: Vea TracChangeset
para ayuda en el uso del visor de conjuntos de cambios.