1 | <?php |
---|
2 | |
---|
3 | /** |
---|
4 | * Sistema Automatizado para la Planificación Estratégico-Situacional en la Administración Pública Venezolana |
---|
5 | * @file gestion_mensajes.install |
---|
6 | * Drupal part Module to code proyectos operativos 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. Diego Uzcategui |
---|
24 | * @date 2013-02-07 // (anno-mes-dia) |
---|
25 | * @version 0.1 |
---|
26 | * |
---|
27 | */ |
---|
28 | |
---|
29 | /* |
---|
30 | * Implementation of hook_install() |
---|
31 | */ |
---|
32 | function gestion_mensajes_install() { |
---|
33 | |
---|
34 | drupal_install_schema('gestion_mensajes'); |
---|
35 | db_query("DELETE FROM {cache}"); |
---|
36 | |
---|
37 | } |
---|
38 | |
---|
39 | /* |
---|
40 | * Implementation of hook_uninstall() |
---|
41 | */ |
---|
42 | function gestion_mensajes_uninstall() { |
---|
43 | |
---|
44 | drupal_uninstall_schema('gestion_mensajes'); |
---|
45 | db_query("DELETE FROM {cache}"); |
---|
46 | |
---|
47 | } |
---|
48 | |
---|
49 | /** |
---|
50 | * Implementation of hook_schema() |
---|
51 | * @return array of Schema API table definitions. |
---|
52 | */ |
---|
53 | function gestion_mensajes_schema() { |
---|
54 | |
---|
55 | $schema['bandejaentrada_usuario'] = array( |
---|
56 | 'description' => 'Bandeja de entrada.', |
---|
57 | 'fields' => array( |
---|
58 | 'id_bandeja_msj' => array( |
---|
59 | 'description' => 'The id identifier to msj.', |
---|
60 | 'type' => 'serial', |
---|
61 | 'not null' => TRUE, |
---|
62 | ), |
---|
63 | 'buid' => array( |
---|
64 | 'description' => 'Referencia al usuario que recibe el mensaje. Identificador de la bandeja de entrada.', |
---|
65 | 'type' => 'int', |
---|
66 | 'unsigned' => TRUE, |
---|
67 | 'not null' => TRUE, |
---|
68 | 'default' => 0, |
---|
69 | ), |
---|
70 | 'id_msj' => array( |
---|
71 | 'description' => 'The id identifier to msj.', |
---|
72 | 'type' => 'int', |
---|
73 | 'unsigned' => TRUE, |
---|
74 | 'not null' => TRUE, |
---|
75 | ), |
---|
76 | 'visto_por_destinatario' => array( |
---|
77 | 'description' => '0 si no ha visto el mensaje, 1 caso contrario.', |
---|
78 | 'type' => 'int', |
---|
79 | 'unsigned' => TRUE, |
---|
80 | 'default' => 0, |
---|
81 | 'size' => 'tiny', |
---|
82 | ), |
---|
83 | ), |
---|
84 | 'indexes' => array( |
---|
85 | 'id_bandeja_msj' => array('id_bandeja_msj'), |
---|
86 | ), |
---|
87 | 'primary key' => array('id_bandeja_msj'), |
---|
88 | ); |
---|
89 | |
---|
90 | $schema['bandejaentrada_usuario_mensajes'] = array( |
---|
91 | 'description' => 'Mensajes sobre los cambios de estado.', |
---|
92 | 'fields' => array( |
---|
93 | 'id_msj' => array( |
---|
94 | 'description' => 'The id identifier to msj.', |
---|
95 | 'type' => 'serial', |
---|
96 | 'not null' => TRUE, |
---|
97 | ), |
---|
98 | 'fecha' => array( |
---|
99 | 'description' => 'Fecha.', |
---|
100 | 'type' => 'int', |
---|
101 | 'unsigned' => TRUE, |
---|
102 | 'not null' => TRUE, |
---|
103 | 'default' => 0, |
---|
104 | ), |
---|
105 | 'nid' => array( |
---|
106 | 'description' => 'nid del nodo asociado a la transición de estado.', |
---|
107 | 'type' => 'int', |
---|
108 | 'unsigned' => TRUE, |
---|
109 | 'not null' => TRUE, |
---|
110 | 'default' => 0, |
---|
111 | ), |
---|
112 | 'tipo_proceso' => array( |
---|
113 | 'description' => 'tipo de proceso: 1 formulación, 2 reformulación o 3 seguimiento.', |
---|
114 | 'type' => 'int', |
---|
115 | 'unsigned' => TRUE, |
---|
116 | 'not null' => TRUE, |
---|
117 | 'default' => 0, |
---|
118 | ), |
---|
119 | 'euid' => array( |
---|
120 | 'description' => 'Referencia al usuario que ejecuto la operación.', |
---|
121 | 'type' => 'int', |
---|
122 | 'unsigned' => TRUE, |
---|
123 | 'not null' => TRUE, |
---|
124 | 'default' => 0, |
---|
125 | ), |
---|
126 | 'estado' => array( |
---|
127 | 'description' => 'estado resultante.', |
---|
128 | 'type' => 'int', |
---|
129 | 'unsigned' => TRUE, |
---|
130 | 'not null' => TRUE, |
---|
131 | 'default' => 0, |
---|
132 | ), |
---|
133 | 'mensaje' => array( |
---|
134 | 'type' => 'text', |
---|
135 | 'size' => 'big', |
---|
136 | 'not null' => TRUE, |
---|
137 | 'default' => '' |
---|
138 | ), |
---|
139 | 'visto_por_admin' => array( |
---|
140 | 'description' => '0 si no ha visto el mensaje, 1 caso contrario.', |
---|
141 | 'type' => 'int', |
---|
142 | 'unsigned' => TRUE, |
---|
143 | 'default' => 0, |
---|
144 | 'size' => 'tiny', |
---|
145 | ), |
---|
146 | ), |
---|
147 | 'indexes' => array( |
---|
148 | 'id_msj' => array('id_msj'), |
---|
149 | ), |
---|
150 | 'primary key' => array('id_msj'), |
---|
151 | ); |
---|
152 | |
---|
153 | return $schema; |
---|
154 | } |
---|