source: sipes/0.3-modules/ente_planificador_sector/includes/views/ente_planificador_sector.views.inc @ 303fae2

stableversion-3.0
Last change on this file since 303fae2 was 303fae2, checked in by José Gregorio Puentes <jpuentes@…>, 9 años ago

se agregaron los modulos

  • Propiedad mode establecida a 100755
File size: 10.0 KB
Línea 
1<?php
2  /**
3  *
4  * Sistema Automatizado para la Planificación Estratégico-Situacional en la Administración Pública Venezolana
5  * @file ente_planificador_sector.views.inc
6  * Drupal part Module to install ente planificador module
7  * Copyright 2011 Sistema Automatizado para la Planificación Estratégico-Situacional en la Administración Pública Venezolana (CENDITEL)
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
22  *
23  * @author Cenditel Merida - Ing. Jose Puentes
24  * @date 2014-11-19 // (a&#241;o-mes-dia)
25  * @version 0.2 // (0.1)
26  *
27  */
28 
29/**
30 * Implementation of hook_views_data_alter()
31 */
32 function ente_planificador_sector_views_data_alter(&$data) {
33   $data['ente_planificador']['sector'] = array(
34     'title' => t('Sector'),
35     'help' => t('El Sector al que pertenece el Ente Planificador.'),
36     'field' => array(
37       'handler' => 'handler_field_ente_sector',
38       'click sortable' => TRUE,
39     ),
40     'sort' => array(
41       'handler' => 'views_handler_sort',
42     ),
43     'filter' => array(
44       'handler' => 'views_handler_filter_ente_sector',
45     ),
46     'argument' => array(
47       'handler' => 'views_handler_argument_string',
48     ),
49   );
50   $data['ente_planificador']['ambito'] = array(
51     'title' => t('Ambito'),
52     'help' => t('Lista de ambitos.'),
53     'field' => array(
54       'handler' => 'handler_field_ente_ambito',
55       'click sortable' => TRUE,
56     ),
57     'sort' => array(
58       'handler' => 'views_handler_sort',
59     ),
60     'filter' => array(
61       'handler' => 'views_handler_filter_ente_ambito',
62     ),
63     'argument' => array(
64       'handler' => 'views_handler_argument_string',
65     ),
66   );
67   $data['ente_planificador']['organismo'] = array(
68     'title' => t('Organismo'),
69     'help' => t('Selecciona todos los entes planificadores que son organismo publicos.'),
70     'filter' => array(
71       'handler' => 'views_handler_filter_ente_organismo',
72     ),
73     'argument' => array(
74       'handler' => 'views_handler_argument_string',
75     ),
76   );
77   $data['ente_planificador']['sub_sector'] = array(
78     'title' => t('Sub-Sector'),
79     'help' => t('Selecciona los sub-sectores del ente planificador.'),
80     'filter' => array(
81       'handler' => 'views_handler_filter_ente_sub_sector',
82     ),
83     'argument' => array(
84       'handler' => 'views_handler_argument_string',
85     ),
86   );
87   $data['ente_planificador']['nivel'] = array(
88      'title' => t('nivel de planificacion'),
89      'help' => t('Nivel de planificacion en la que se encuentra el Ente Planificador.'),
90      'field' => array(
91        'handler' => 'handler_field_ente_nivel',
92        'click sortable' => TRUE,
93      ),
94      'sort' => array(
95        'handler' => 'views_handler_sort',
96      ),
97      'filter' => array(
98        'handler' => 'views_handler_filter_ente_nivel',
99      ),
100      'argument' => array(
101        'handler' => 'views_handler_argument_string',
102      ),
103    );
104   $data['ente_user_planificador']['table']['group']  = t('Entes Planificadores');
105   $data['ente_user_planificador']['table']['join'] = array(
106     'node' => array(
107      'left_field' => 'nid',
108      'field' => 'nid',
109      'type' => 'INNER',
110     ),
111   );
112   $data['ente_user_planificador']['nombres_ente'] = array(
113    'title' => t('Ente Planificador'),
114    'help' => t('Ente planificador que tiene asociado usuarios.'),
115    'field' => array(
116      'field' => 'usuario', // the real field
117      'handler' => 'handler_field_user_ente',
118      'click sortable' => TRUE,
119    ),
120    'sort' => array(
121      'handler' => 'views_handler_sort',
122    ),
123    'argument' => array(
124      'handler' => 'views_handler_argument_string',
125    ),
126   );
127   $data['ente_user_planificador']['users_name'] = array(
128    'title' => t('Nombre de Usuario'),
129    'help' => t('Nombre de Usuario.'),
130    'field' => array(
131      'field' => 'nid', // the real field
132      'handler' => 'handler_field_usuarios_name',
133      'click sortable' => TRUE,
134    ),
135    'sort' => array(
136      'handler' => 'views_handler_sort',
137    ),
138    'argument' => array(
139      'handler' => 'views_handler_argument_string',
140    ),
141  );
142   $data['ente_user_planificador']['nombres_usuarios'] = array(
143    'title' => t('Nombres'),
144    'help' => t('Nombres del Usuario.'),
145    'field' => array(
146      'field' => 'nid', // the real field
147      'handler' => 'handler_field_usuarios_nombres',
148      'click sortable' => TRUE,
149    ),
150    'sort' => array(
151      'handler' => 'views_handler_sort',
152    ),
153    'argument' => array(
154      'handler' => 'views_handler_argument_string',
155    ),
156   );
157   $data['ente_user_planificador']['apellidos_ente'] = array(
158    'title' => t('Apellidos'),
159    'help' => t('Apellidos del Usuario.'),
160    'field' => array(
161      'field' => 'nid', // the real field
162      'handler' => 'handler_field_usuarios_apellidos',
163      'click sortable' => TRUE,
164    ),
165    'sort' => array(
166      'handler' => 'views_handler_sort',
167    ),
168    'argument' => array(
169      'handler' => 'views_handler_argument_string',
170    ),
171   );
172   $data['ente_user_planificador']['cedula_ente'] = array(
173    'title' => t('Cedula del Usuario'),
174    'help' => t('Cedula del usuario.'),
175    'field' => array(
176      'field' => 'nid', // the real field
177      'handler' => 'handler_field_usuarios_cedula',
178      'click sortable' => TRUE,
179    ),
180    'sort' => array(
181      'handler' => 'views_handler_sort',
182    ),
183    'argument' => array(
184      'handler' => 'views_handler_argument_string',
185    ),
186  );
187   //campos disponibles para el tipo de vista users
188   $data['users']['table']['group']  = t('User');
189   $data['users']['table']['join'] = array(
190     'ente_user_planificador' => array(
191      'left_field' => 'usuario',
192      'field' => 'uid',
193     ),
194   );
195   $data['users']['nombres'] = array(
196    'title' => t('Nombres del Usuario'),
197    'help' => t('Nombres del usuario.'),
198    'field' => array(
199       'handler' => 'handler_field_user_nombres',
200       'click sortable' => TRUE,
201    ),
202    'sort' => array(
203      'handler' => 'views_handler_sort',
204    ),
205    'argument' => array(
206      'handler' => 'views_handler_argument_string',
207    ),
208   );
209   $data['users']['apellidos'] = array(
210    'title' => t('Apellidos del Usuario'),
211    'help' => t('Apellidos del usuario.'),
212    'field' => array(
213      'handler' => 'handler_field_user_apellidos',
214      'click sortable' => TRUE,
215    ),
216    'sort' => array(
217      'handler' => 'views_handler_sort',
218    ),
219    'argument' => array(
220      'handler' => 'views_handler_argument_string',
221    ),
222  );
223  $data['users']['cedula'] = array(
224    'title' => t('Cedula del Usuario'),
225    'help' => t('Cedula del usuario.'),
226    'field' => array(
227      'handler' => 'handler_field_user_cedula',
228      'click sortable' => TRUE,
229    ),
230    'sort' => array(
231      'handler' => 'views_handler_sort',
232    ),
233    'argument' => array(
234      'handler' => 'views_handler_argument_string',
235    ),
236  );
237 }
238
239/**
240 * Implementation of hook_views_handlers().
241 */
242 function ente_planificador_sector_views_handlers() {
243   return array(
244     'info' => array(
245       'path' => drupal_get_path('module', 'ente_planificador_sector') . '/includes/views',
246     ),
247     'handlers' => array(
248       'views_handler_filter_ente_sector' => array(
249         'parent' => 'views_handler_filter_many_to_one',
250       ),
251       'views_handler_filter_ente_sub_sector' => array(
252         'parent' => 'views_handler_filter_many_to_one',
253       ),
254       'views_handler_filter_ente_ambito' => array(
255         'parent' => 'views_handler_filter_many_to_one',
256       ),
257       'views_handler_filter_ente_organismo' => array(
258         'parent' => 'views_handler_filter_many_to_one',
259       ),
260      'views_handler_filter_ente_nivel' => array(
261         'parent' => 'views_handler_filter_many_to_one',
262      ),
263       //campos disponible en nodos
264       'handler_field_ente_sector' => array(
265         'parent' => 'views_handler_field',
266       ),
267       'handler_field_ente_ambito' => array(
268         'parent' => 'views_handler_field',
269       ),
270      'handler_field_ente_nivel' => array(
271        'parent' => 'views_handler_field',
272       ),
273       'handler_field_ente_user' => array(
274         'parent' => 'views_handler_field',
275       ),
276       'handler_field_usuarios_nombres' => array(
277         'parent' => 'views_handler_field',
278       ),
279       'handler_field_usuarios_cedula' => array(
280         'parent' => 'views_handler_field',
281       ),
282       'handler_field_usuarios_apellidos' => array(
283         'parent' => 'views_handler_field',
284       ),
285       'handler_field_usuarios_name' => array(
286         'parent' => 'views_handler_field',
287       ),
288       //campos disponible en user
289       'handler_field_user_ente' => array(
290         'parent' => 'views_handler_field',
291       ),
292       'handler_field_user_nombres' => array(
293         'parent' => 'views_handler_field',
294       ),
295       'handler_field_user_apellidos' => array(
296         'parent' => 'views_handler_field',
297       ),
298       'handler_field_user_cedula' => array(
299         'parent' => 'views_handler_field',
300       ),
301     ),
302   );
303 }
304
305/**
306 * Implementation of hook_views_plugins
307 */
308function ente_planificador_sector_views_plugins() {
309  return array(
310    'module' => 'views', // This just tells our themes are elsewhere.
311    'argument default' => array(
312      'mi_ambito' => array(
313        'title' => t('Tid del Ambito que posee el usuario actual'),
314        'handler' => 'views_plugin_argument_default_mi_ambito',
315        'path' => drupal_get_path('module', 'ente_planificador_sector') . '/includes/views',
316        'parent' => 'fixed',
317      ),
318    ),
319  );
320}
321
Nota: Vea TracBrowser para ayuda de uso del navegador del repositorio.