1 | <?php |
---|
2 | /** |
---|
3 | * Sistema Integral de Planificación y Presupuesto (SIPP) |
---|
4 | * @file reportes_sipes_views.module |
---|
5 | * Drupal part Module to Sistema Integral de Planificación y Presupuesto (SIPP) |
---|
6 | * Copyright 2013 Sistema Automatizado para la Planificación Estratégico-Situacional en la Administración Pública Venezolana (CENDITEL) |
---|
7 | * |
---|
8 | * This program is free software; you can redistribute it and/or modify |
---|
9 | * it under the terms of the GNU General Public License as published by |
---|
10 | * the Free Software Foundation; either version 2 of the License, or |
---|
11 | * (at your option) any later version. |
---|
12 | * |
---|
13 | * This program is distributed in the hope that it will be useful, |
---|
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
16 | * GNU General Public License for more details. |
---|
17 | * |
---|
18 | * You should have received a copy of the GNU General Public License |
---|
19 | * along with this program; if not, write to the Free Software |
---|
20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
---|
21 | * |
---|
22 | * @author Cenditel Merida - Ing. Diego Uzcátegui (diego.uzc [at] gmail [dot] com) |
---|
23 | * @date 2013-04-25 // (año-mes-dia) |
---|
24 | * @version 0.1 // (0.1) |
---|
25 | * |
---|
26 | */ |
---|
27 | |
---|
28 | /* |
---|
29 | * Implementation of hook_menu() |
---|
30 | */ |
---|
31 | function reportes_sipp_menu() { |
---|
32 | $items = array(); |
---|
33 | |
---|
34 | $items['reportes_sipes_views'] = array( |
---|
35 | 'title' => t('Reportes'), |
---|
36 | 'page callback' => 'reporte_sipes_page', |
---|
37 | 'access callback' => true, |
---|
38 | 'type' => MENU_CALLBACK, |
---|
39 | ); |
---|
40 | |
---|
41 | return $items; |
---|
42 | } // function reportes_sipp_menu |
---|
43 | |
---|
44 | |
---|
45 | /** |
---|
46 | * Implementation of hook_views_api(). |
---|
47 | */ |
---|
48 | function reportes_sipp_views_api() { |
---|
49 | return array( |
---|
50 | 'api' => '2.0', |
---|
51 | 'path' => drupal_get_path('module', 'reportes_sipp') . '/views', |
---|
52 | ); |
---|
53 | } |
---|
54 | |
---|
55 | /** |
---|
56 | * Genera el reporte |
---|
57 | */ |
---|
58 | function reporte_sipes_page() { |
---|
59 | $content = ''; |
---|
60 | |
---|
61 | $view_id = ''; |
---|
62 | $view = views_get_view($view_id); |
---|
63 | $display_id = 'default'; |
---|
64 | $view->set_display($display_id); |
---|
65 | $view->override_path = $_GET['q']; |
---|
66 | $view->pre_execute(); |
---|
67 | $view->execute(); |
---|
68 | $output = $view->render(); |
---|
69 | |
---|
70 | return $content; |
---|
71 | } |
---|