1 | <?php |
---|
2 | |
---|
3 | /** |
---|
4 | * |
---|
5 | * Sistema Automatizado para la Planificación Estratégico-Situacional en la Administración Pública Venezolana |
---|
6 | * @file handler_field_ente_usuario.inc |
---|
7 | * Drupal part Module to install ente planificador module |
---|
8 | * Copyright 2011 Sistema Automatizado para la Planificación Estratégico-Situacional en la Administración Pública Venezolana (CENDITEL) |
---|
9 | * |
---|
10 | * This program is free software; you can redistribute it and/or modify |
---|
11 | * it under the terms of the GNU General Public License as published by |
---|
12 | * the Free Software Foundation; either version 2 of the License, or |
---|
13 | * (at your option) any later version. |
---|
14 | * |
---|
15 | * This program is distributed in the hope that it will be useful, |
---|
16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
18 | * GNU General Public License for more details. |
---|
19 | * |
---|
20 | * You should have received a copy of the GNU General Public License |
---|
21 | * along with this program; if not, write to the Free Software |
---|
22 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
---|
23 | * |
---|
24 | * Probado con un servidor Apache 2.0, |
---|
25 | * Postgresql version 7.4.7 y 8.1 mysql 5.0.32 y PHP version 4.3.11 y 5.2.0-8 |
---|
26 | * |
---|
27 | * @author Cenditel Merida - Ing. Jose Puentes |
---|
28 | * @date 2014/12/19 // (año-mes-dia) |
---|
29 | * @version 0.2 // (0.1) |
---|
30 | * |
---|
31 | */ |
---|
32 | |
---|
33 | /** |
---|
34 | * Mostrar los entes planificadores en views. |
---|
35 | */ |
---|
36 | class handler_field_user_ente extends views_handler_field { |
---|
37 | function render($values) { |
---|
38 | $title = ''; |
---|
39 | if ($values->{$this->field_alias}) { |
---|
40 | $result = db_query("SELECT u.usuario, n.title FROM {ente_user_planificador} as u INNER JOIN {node} as n ON u.nid = n.nid WHERE u.usuario = %d", $values->ente_user_planificador_usuario); |
---|
41 | while($row = db_fetch_object($result)) { |
---|
42 | $title = l($row->title, 'user/' . $row->usuario, array('html' => true, 'query' => 'destination=administrar_usuarios')); |
---|
43 | } |
---|
44 | } |
---|
45 | return $title; |
---|
46 | } |
---|
47 | } |
---|