[303fae2] | 1 | <?php |
---|
| 2 | |
---|
| 3 | /** |
---|
| 4 | * Sistema Integral de Planificación y Presupuesto (SIPP) |
---|
| 5 | * @file proyectos_operativos_extra.module |
---|
| 6 | * Drupal part Module to Sistema Integral de Planificación y Presupuesto (SIPP) |
---|
| 7 | * Copyright 2013 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 - Msc. Juan Vizcarrondo |
---|
| 24 | * @date 2013-02-02 // (año-mes-dia) |
---|
| 25 | * @version 0.1 // (0.1) |
---|
| 26 | * |
---|
| 27 | */ |
---|
| 28 | |
---|
| 29 | /** |
---|
| 30 | * Implementation of hook_uninstall(). |
---|
| 31 | */ |
---|
| 32 | function proyectos_operativos_extra_uninstall() { |
---|
| 33 | db_query("DELETE FROM {variable} WHERE name LIKE '%s'", 'proyectos_operativos_extra_unidad%'); |
---|
| 34 | } |
---|
| 35 | |
---|
| 36 | /** |
---|
| 37 | * Implementation of hook_enable(). |
---|
| 38 | */ |
---|
| 39 | function proyectos_operativos_extra_enable() { |
---|
| 40 | drupal_load('module', 'taxonomy'); |
---|
| 41 | module_load_include('inc', 'proyectos_operativos_extra', 'proyectos_operativos_extra.features'); |
---|
| 42 | //SE AGREGA LA UNIDAD DE MEDIDA |
---|
| 43 | $vocabulary = taxonomy_vocabulary_load(variable_get('proyectos_operativos_extra_unidad', 0)); |
---|
| 44 | if (!$vocabulary) { |
---|
| 45 | $vocabulary = array( |
---|
| 46 | 'name' => t('Unidades de Medida'), |
---|
| 47 | 'multiple' => 0, |
---|
| 48 | 'required' => 0, |
---|
| 49 | 'hierarchy' => 1, |
---|
| 50 | 'relations' => 0, |
---|
| 51 | 'module' => 'proyectos_operativos_extra', |
---|
| 52 | 'weight' => -10, |
---|
| 53 | ); |
---|
| 54 | taxonomy_save_vocabulary($vocabulary); |
---|
| 55 | variable_set('proyectos_operativos_extra_unidad', $vocabulary['vid']); |
---|
| 56 | _proyectos_operativos_extra_agregar_unidad_medida($vocabulary['vid']); |
---|
| 57 | } |
---|
| 58 | //SE AGREGA ESTADO DEL PROYECTO |
---|
| 59 | //USADA POR Estado del Proyecto (field_proyecto_status) |
---|
| 60 | $vocabulary = taxonomy_vocabulary_load(variable_get('proyectos_operativos_extra_status', 0)); |
---|
| 61 | if (!$vocabulary) { |
---|
| 62 | $vocabulary = array( |
---|
| 63 | 'name' => t('Estado del Proyecto'), |
---|
| 64 | 'multiple' => 0, |
---|
| 65 | 'required' => 0, |
---|
| 66 | 'hierarchy' => 1, |
---|
| 67 | 'relations' => 0, |
---|
| 68 | 'module' => 'proyectos_operativos_extra', |
---|
| 69 | 'weight' => -10, |
---|
| 70 | ); |
---|
| 71 | taxonomy_save_vocabulary($vocabulary); |
---|
| 72 | variable_set('proyectos_operativos_extra_status', $vocabulary['vid']); |
---|
| 73 | _proyectos_operativos_extra_agregar_estado_proyecto($vocabulary['vid']); |
---|
| 74 | } |
---|
| 75 | //SE AGREGA SITUACION PRESUPUESTARIA |
---|
| 76 | //USADA POR Situación Presupuestaria (field_proyecto_situacion_p) |
---|
| 77 | $vocabulary = taxonomy_vocabulary_load(variable_get('proyectos_operativos_extra_situacionp', 0)); |
---|
| 78 | if (!$vocabulary) { |
---|
| 79 | $vocabulary = array( |
---|
| 80 | 'name' => t('Situación Presupuestaria'), |
---|
| 81 | 'multiple' => 0, |
---|
| 82 | 'required' => 0, |
---|
| 83 | 'hierarchy' => 1, |
---|
| 84 | 'relations' => 0, |
---|
| 85 | 'module' => 'proyectos_operativos_extra', |
---|
| 86 | 'weight' => -10, |
---|
| 87 | ); |
---|
| 88 | taxonomy_save_vocabulary($vocabulary); |
---|
| 89 | variable_set('proyectos_operativos_extra_situacionp', $vocabulary['vid']); |
---|
| 90 | _proyectos_operativos_extra_agregar_situacionp($vocabulary['vid']); |
---|
| 91 | } |
---|
| 92 | //SE AGREGA AFIRMACION |
---|
| 93 | //USADA POR Proyecto Plurianual (field_proyecto_plurianual) Y Considerado para el POAN (field_proyecto_poan) |
---|
| 94 | $vocabulary = taxonomy_vocabulary_load(variable_get('proyectos_operativos_extra_afirmacion', 0)); |
---|
| 95 | if (!$vocabulary) { |
---|
| 96 | $vocabulary = array( |
---|
| 97 | 'name' => t('Afirmacion'), |
---|
| 98 | 'multiple' => 0, |
---|
| 99 | 'required' => 0, |
---|
| 100 | 'hierarchy' => 1, |
---|
| 101 | 'relations' => 0, |
---|
| 102 | 'module' => 'proyectos_operativos_extra', |
---|
| 103 | 'weight' => -10, |
---|
| 104 | ); |
---|
| 105 | taxonomy_save_vocabulary($vocabulary); |
---|
| 106 | variable_set('proyectos_operativos_extra_afirmacion', $vocabulary['vid']); |
---|
| 107 | _proyectos_operativos_extra_agregar_afirmacion($vocabulary['vid']); |
---|
| 108 | } |
---|
| 109 | |
---|
| 110 | |
---|
| 111 | $vocabulary = taxonomy_vocabulary_load(variable_get('proyectos_operativos_extra_sector', 0)); |
---|
| 112 | if (!$vocabulary) { |
---|
| 113 | $vocabulary = array( |
---|
| 114 | 'name' => t('Sector'), |
---|
| 115 | 'multiple' => 0, |
---|
| 116 | 'required' => 0, |
---|
| 117 | 'hierarchy' => 1, |
---|
| 118 | 'relations' => 0, |
---|
| 119 | 'module' => 'proyectos_operativos_extra', |
---|
| 120 | 'weight' => -10, |
---|
| 121 | ); |
---|
| 122 | taxonomy_save_vocabulary($vocabulary); |
---|
| 123 | variable_set('proyectos_operativos_extra_sector', $vocabulary['vid']); |
---|
| 124 | _proyectos_operativos_extra__agregar_sector($vocabulary['vid']); |
---|
| 125 | } |
---|
| 126 | $vocabulary = taxonomy_vocabulary_load(variable_get('proyectos_operativos_extra_bene', 0)); |
---|
| 127 | if (!$vocabulary) { |
---|
| 128 | $vocabulary = array( |
---|
| 129 | 'name' => t('Beneficiarios'), |
---|
| 130 | 'multiple' => 0, |
---|
| 131 | 'required' => 0, |
---|
| 132 | 'hierarchy' => 1, |
---|
| 133 | 'relations' => 0, |
---|
| 134 | 'module' => 'proyectos_operativos_extra', |
---|
| 135 | 'weight' => -10, |
---|
| 136 | ); |
---|
| 137 | taxonomy_save_vocabulary($vocabulary); |
---|
| 138 | variable_set('proyectos_operativos_extra_bene', $vocabulary['vid']); |
---|
| 139 | _proyectos_operativos_extra_agregar_beneficiario($vocabulary['vid']); |
---|
| 140 | } |
---|
| 141 | $vocabulary = taxonomy_vocabulary_load(variable_get('proyectos_operativos_extra_partacc', 0)); |
---|
| 142 | if (!$vocabulary) { |
---|
| 143 | $vocabulary = array( |
---|
| 144 | 'name' => t('Partidas AE'), |
---|
| 145 | 'multiple' => 0, |
---|
| 146 | 'required' => 0, |
---|
| 147 | 'hierarchy' => 1, |
---|
| 148 | 'relations' => 0, |
---|
| 149 | 'module' => 'proyectos_operativos_extra', |
---|
| 150 | 'weight' => -10, |
---|
| 151 | ); |
---|
| 152 | taxonomy_save_vocabulary($vocabulary); |
---|
| 153 | variable_set('proyectos_operativos_extra_partacc', $vocabulary['vid']); |
---|
| 154 | _proyectos_operativos_extra_agregar_partida_acciones($vocabulary['vid']); |
---|
| 155 | } |
---|
| 156 | $vocabulary = taxonomy_vocabulary_load(variable_get('proyectos_operativos_extra_entidad', 0)); |
---|
| 157 | if (!$vocabulary) { |
---|
| 158 | $vocabulary = array( |
---|
| 159 | 'name' => t('Paises'), |
---|
| 160 | 'multiple' => 0, |
---|
| 161 | 'required' => 0, |
---|
| 162 | 'hierarchy' => 1, |
---|
| 163 | 'relations' => 0, |
---|
| 164 | 'module' => 'proyectos_operativos_extra', |
---|
| 165 | 'weight' => -10, |
---|
| 166 | ); |
---|
| 167 | taxonomy_save_vocabulary($vocabulary); |
---|
| 168 | variable_set('proyectos_operativos_extra_entidad', $vocabulary['vid']); |
---|
| 169 | _proyectos_operativos_extra_agregar_entidades($vocabulary['vid']); |
---|
| 170 | } |
---|
| 171 | $vocabulary = taxonomy_vocabulary_load(variable_get('proyectos_operativos_pdlp', 0)); |
---|
| 172 | if (!$vocabulary) { |
---|
| 173 | $vocabulary = array( |
---|
| 174 | 'name' => t('Plan de la Patria1'), |
---|
| 175 | 'multiple' => 0, |
---|
| 176 | 'required' => 0, |
---|
| 177 | 'hierarchy' => 1, |
---|
| 178 | 'relations' => 0, |
---|
| 179 | 'module' => 'proyectos_operativos_extra', |
---|
| 180 | 'weight' => -10, |
---|
| 181 | ); |
---|
| 182 | taxonomy_save_vocabulary($vocabulary); |
---|
| 183 | variable_set('proyectos_operativos_pdlp', $vocabulary['vid']); |
---|
| 184 | _proyectos_operativos_extra_agregar_pdlp($vocabulary['vid']); |
---|
| 185 | } |
---|
| 186 | } |
---|