1 | <?php |
---|
2 | |
---|
3 | /** |
---|
4 | * Sistema Automatizado para la Planificación Estratégico-Situacional en la Administración Pública Venezolana |
---|
5 | * @file accion_especifica_de_proyecto_seguimiento.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 accion_especifica_de_proyecto_seguimiento_install() { |
---|
33 | // Notify content module when this module is uninstalled. |
---|
34 | //drupal_load('module', 'content'); |
---|
35 | //content_notify('install', 'accion_especifica_de_proyecto_seguimiento'); |
---|
36 | drupal_install_schema('accion_especifica_de_proyecto_seguimiento'); |
---|
37 | db_query("DELETE FROM {cache}"); |
---|
38 | |
---|
39 | /* |
---|
40 | // CCK content_copy.module may not be enabled, so make sure it is included |
---|
41 | require_once './' . drupal_get_path('module', 'content'). '/modules/content_copy/content_copy.module'; |
---|
42 | module_load_include('inc', 'accion_especifica_de_proyecto_seguimiento', 'includes/00_instalacion/seguimiento_mes_tiponodo.ccknodedef'); |
---|
43 | $content = _seguimientoMesNodo_content_type_export(); // in modulename.ccknodedef.inc |
---|
44 | $form_state['values']['type_name'] = 'mymodule'; //don't use <create> here as you want to extend existing content type |
---|
45 | $form_state['values']['macro'] = '$content = ' . var_export($content, TRUE) . ';'; |
---|
46 | // form provided by content_copy.module |
---|
47 | drupal_execute('content_copy_import_form', $form_state); |
---|
48 | content_clear_type_cache(); |
---|
49 | |
---|
50 | module_load_include('inc', 'accion_especifica_de_proyecto_seguimiento', 'includes/00_instalacion/crear_flujodetrabajo.workflow'); |
---|
51 | _crear_flujodetrabajo_seguimientoMes(); |
---|
52 | content_notify('install', 'accion_especifica_de_proyecto_seguimiento'); |
---|
53 | */ |
---|
54 | } |
---|
55 | |
---|
56 | /* |
---|
57 | * Implementation of hook_uninstall() |
---|
58 | */ |
---|
59 | function accion_especifica_de_proyecto_seguimiento_uninstall() { |
---|
60 | // Notify content module when this module is uninstalled. |
---|
61 | //content_notify('uninstall', 'accion_especifica_de_proyecto_seguimiento'); |
---|
62 | //drupal_uninstall_schema('accion_especifica_de_proyecto_seguimiento'); |
---|
63 | drupal_uninstall_schema('accion_especifica_de_proyecto_seguimiento'); |
---|
64 | db_query("DELETE FROM {cache}"); |
---|
65 | |
---|
66 | /* |
---|
67 | module_load_include('inc', 'content', 'includes/content.crud'); |
---|
68 | content_field_instance_delete('field_ccktest', 'nodo_seguimiento_mes', FALSE); |
---|
69 | */ |
---|
70 | } |
---|
71 | |
---|
72 | /** |
---|
73 | * Implementation of hook_schema() |
---|
74 | * @return array of Schema API table definitions. |
---|
75 | */ |
---|
76 | function accion_especifica_de_proyecto_seguimiento_schema() { |
---|
77 | //$schema = array(); |
---|
78 | |
---|
79 | $schema['seguimiento_aeproyecto'] = array( |
---|
80 | 'description' => 'Seguimiento.', |
---|
81 | 'fields' => array( |
---|
82 | 'id_seg' => array( |
---|
83 | 'description' => 'The id identifier to seguimiento.', |
---|
84 | 'type' => 'serial', |
---|
85 | 'not null' => TRUE, |
---|
86 | ), |
---|
87 | 'nid' => array( |
---|
88 | 'description' => 'nid del nodo.', |
---|
89 | 'type' => 'int', |
---|
90 | 'unsigned' => TRUE, |
---|
91 | 'not null' => TRUE, |
---|
92 | 'default' => 0, |
---|
93 | ), |
---|
94 | 'acumulativa' => array( |
---|
95 | 'description' => 'Si la acción especifica se considera acumulativa.', |
---|
96 | 'type' => 'int', |
---|
97 | ), |
---|
98 | 'estado' => array( |
---|
99 | 'description' => 'estado actual.', |
---|
100 | 'type' => 'int', |
---|
101 | 'unsigned' => TRUE, |
---|
102 | 'not null' => TRUE, |
---|
103 | 'default' => 0, |
---|
104 | ), |
---|
105 | 'id_seg_transicion_estado' => array( |
---|
106 | 'description' => 'identificador a ultima transicion.', |
---|
107 | 'type' => 'int', |
---|
108 | 'unsigned' => TRUE, |
---|
109 | 'not null' => TRUE, |
---|
110 | 'default' => 0, |
---|
111 | ), |
---|
112 | 'fecha' => array( |
---|
113 | 'description' => 'Fecha.', |
---|
114 | 'type' => 'int', |
---|
115 | 'unsigned' => TRUE, |
---|
116 | 'not null' => TRUE, |
---|
117 | 'default' => 0, |
---|
118 | ), |
---|
119 | 'mes' => array( |
---|
120 | 'description' => 'Referencia a la reformulacion.', |
---|
121 | 'type' => 'int', |
---|
122 | 'unsigned' => TRUE, |
---|
123 | 'not null' => TRUE, |
---|
124 | 'default' => 0, |
---|
125 | ), |
---|
126 | 'ejecutadometafisica' => array( |
---|
127 | 'description' => 'Cantidad de ejecutado en la meta fisica para el mes actual', |
---|
128 | 'type' => 'int', |
---|
129 | 'unsigned' => TRUE, |
---|
130 | 'not null' => TRUE, |
---|
131 | 'default' => 0, |
---|
132 | ), |
---|
133 | 'infocomplementaria_metafisica' => array( |
---|
134 | 'type' => 'text', |
---|
135 | 'size' => 'big', |
---|
136 | 'not null' => TRUE, |
---|
137 | 'default' => '' |
---|
138 | ), |
---|
139 | 'infocomplementaria_metafinanciera' => array( |
---|
140 | 'type' => 'text', |
---|
141 | 'size' => 'big', |
---|
142 | 'not null' => TRUE, |
---|
143 | 'default' => '' |
---|
144 | ), |
---|
145 | 'uid' => array( |
---|
146 | 'description' => 'Referencia al autor.', |
---|
147 | 'type' => 'int', |
---|
148 | 'unsigned' => TRUE, |
---|
149 | 'not null' => TRUE, |
---|
150 | 'default' => 0, |
---|
151 | ), |
---|
152 | ), |
---|
153 | 'indexes' => array( |
---|
154 | 'nid' => array('nid'), |
---|
155 | 'id_seg' => array('id_seg'), |
---|
156 | 'uid' => array('uid'), |
---|
157 | 'mes' => array('mes'), |
---|
158 | 'estado' => array('estado'), |
---|
159 | ), |
---|
160 | 'primary key' => array('id_seg'), |
---|
161 | ); |
---|
162 | |
---|
163 | $schema['seguimiento_aeproyecto_partida'] = array( |
---|
164 | 'description' => 'seguimiento partidas.', |
---|
165 | 'fields' => array( |
---|
166 | 'id_seg_partida' => array( |
---|
167 | 'description' => 'The id identifier to seguimiento.', |
---|
168 | 'type' => 'serial', |
---|
169 | 'not null' => TRUE, |
---|
170 | ), |
---|
171 | 'id_seg' => array( |
---|
172 | 'description' => 'id del seguimiento.', |
---|
173 | 'type' => 'int', |
---|
174 | 'unsigned' => TRUE, |
---|
175 | 'not null' => TRUE, |
---|
176 | 'default' => 0, |
---|
177 | ), |
---|
178 | 'partida' => array( |
---|
179 | 'description' => 'Partida del la reformulacion.', |
---|
180 | 'type' => 'int', |
---|
181 | 'unsigned' => TRUE, |
---|
182 | 'not null' => TRUE, |
---|
183 | 'default' => 0, |
---|
184 | ), |
---|
185 | 'comprometido' => array( |
---|
186 | 'description' => 'Comprometido.', |
---|
187 | 'type' => 'numeric', |
---|
188 | 'size' => 'normal', |
---|
189 | 'not null' => TRUE, |
---|
190 | 'default' => 0, |
---|
191 | 'precision' => 32, |
---|
192 | 'scale' => 0, |
---|
193 | ), |
---|
194 | 'causado' => array( |
---|
195 | 'description' => 'Causado.', |
---|
196 | 'type' => 'numeric', |
---|
197 | 'size' => 'normal', |
---|
198 | 'not null' => TRUE, |
---|
199 | 'default' => 0, |
---|
200 | 'precision' => 32, |
---|
201 | 'scale' => 0, |
---|
202 | ), |
---|
203 | 'pagado' => array( |
---|
204 | 'description' => 'Pagado.', |
---|
205 | 'type' => 'numeric', |
---|
206 | 'size' => 'normal', |
---|
207 | 'not null' => TRUE, |
---|
208 | 'default' => 0, |
---|
209 | 'precision' => 32, |
---|
210 | 'scale' => 0, |
---|
211 | ), |
---|
212 | ), |
---|
213 | 'indexes' => array( |
---|
214 | 'id_seg' => array('id_seg'), |
---|
215 | 'partida' => array('partida'), |
---|
216 | ), |
---|
217 | 'primary key' => array('id_seg_partida'), |
---|
218 | ); |
---|
219 | |
---|
220 | $schema['seguimiento_aeproyecto_transiciones_estados'] = array( |
---|
221 | 'description' => 'Estado del seguimiento.', |
---|
222 | 'fields' => array( |
---|
223 | 'id_seg_transicion_estado' => array( |
---|
224 | 'description' => 'The id identifier to seguimiento.', |
---|
225 | 'type' => 'serial', |
---|
226 | 'not null' => TRUE, |
---|
227 | ), |
---|
228 | 'estado' => array( |
---|
229 | 'description' => 'estado.', |
---|
230 | 'type' => 'int', |
---|
231 | 'unsigned' => TRUE, |
---|
232 | 'not null' => TRUE, |
---|
233 | 'default' => 0, |
---|
234 | ), |
---|
235 | 'estado_ant' => array( |
---|
236 | 'description' => 'estado anterior.', |
---|
237 | 'type' => 'int', |
---|
238 | 'unsigned' => TRUE, |
---|
239 | 'not null' => TRUE, |
---|
240 | 'default' => 0, |
---|
241 | ), |
---|
242 | 'date' => array( |
---|
243 | 'description' => 'Fecha.', |
---|
244 | 'type' => 'int', |
---|
245 | 'unsigned' => TRUE, |
---|
246 | 'not null' => TRUE, |
---|
247 | 'default' => 0, |
---|
248 | ), |
---|
249 | 'id_seg' => array( |
---|
250 | 'description' => 'Referencia al seguimiento.', |
---|
251 | 'type' => 'int', |
---|
252 | 'unsigned' => TRUE, |
---|
253 | 'not null' => TRUE, |
---|
254 | 'default' => 0, |
---|
255 | ), |
---|
256 | 'uid' => array( |
---|
257 | 'description' => 'Referencia al autor.', |
---|
258 | 'type' => 'int', |
---|
259 | 'unsigned' => TRUE, |
---|
260 | 'not null' => TRUE, |
---|
261 | 'default' => 0, |
---|
262 | ), |
---|
263 | 'comentario' => array( |
---|
264 | 'type' => 'text', |
---|
265 | 'size' => 'big', |
---|
266 | 'not null' => TRUE, |
---|
267 | 'default' => '' |
---|
268 | ), |
---|
269 | ), |
---|
270 | 'indexes' => array( |
---|
271 | 'id_seg_transicion_estado' => array('id_seg_transicion_estado'), |
---|
272 | 'id_seg' => array('id_seg'), |
---|
273 | 'uid' => array('uid'), |
---|
274 | ), |
---|
275 | 'primary key' => array('id_seg_transicion_estado'), |
---|
276 | ); |
---|
277 | |
---|
278 | return $schema; |
---|
279 | } |
---|