[a0b4327] | 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 | variable_del('proyectos_operativos_extra_unidad'); |
---|
| 34 | variable_del('proyectos_operativos_extra_sector'); |
---|
| 35 | variable_del('proyectos_operativos_extra_bene'); |
---|
| 36 | } |
---|
| 37 | |
---|
| 38 | /** |
---|
| 39 | * Implementation of hook_enable(). |
---|
| 40 | */ |
---|
| 41 | function proyectos_operativos_extra_enable() { |
---|
| 42 | drupal_load('module', 'taxonomy'); |
---|
| 43 | module_load_include('inc', 'proyectos_operativos_extra', 'proyectos_operativos_extra.features'); |
---|
| 44 | $vocabulary = taxonomy_vocabulary_load(variable_get('proyectos_operativos_extra_unidad', 0)); |
---|
| 45 | if (!$vocabulary) { |
---|
| 46 | $vocabulary = array( |
---|
| 47 | 'name' => t('Unidades de Medida'), |
---|
| 48 | 'multiple' => 0, |
---|
| 49 | 'required' => 0, |
---|
| 50 | 'hierarchy' => 1, |
---|
| 51 | 'relations' => 0, |
---|
| 52 | 'module' => 'proyectos_operativos_extra', |
---|
| 53 | 'weight' => -10, |
---|
| 54 | ); |
---|
| 55 | taxonomy_save_vocabulary($vocabulary); |
---|
| 56 | variable_set('proyectos_operativos_extra_unidad', $vocabulary['vid']); |
---|
| 57 | _proyectos_operativos_extra_agregar_unidad_medida($vocabulary['vid']); |
---|
| 58 | } |
---|
| 59 | $vocabulary = taxonomy_vocabulary_load(variable_get('proyectos_operativos_extra_sector', 0)); |
---|
| 60 | if (!$vocabulary) { |
---|
| 61 | $vocabulary = array( |
---|
| 62 | 'name' => t('Sector'), |
---|
| 63 | 'multiple' => 0, |
---|
| 64 | 'required' => 0, |
---|
| 65 | 'hierarchy' => 1, |
---|
| 66 | 'relations' => 0, |
---|
| 67 | 'module' => 'proyectos_operativos_extra', |
---|
| 68 | 'weight' => -10, |
---|
| 69 | ); |
---|
| 70 | taxonomy_save_vocabulary($vocabulary); |
---|
| 71 | variable_set('proyectos_operativos_extra_sector', $vocabulary['vid']); |
---|
| 72 | _proyectos_operativos_extra__agregar_sector($vocabulary['vid']); |
---|
| 73 | } |
---|
| 74 | $vocabulary = taxonomy_vocabulary_load(variable_get('proyectos_operativos_extra_bene', 0)); |
---|
| 75 | if (!$vocabulary) { |
---|
| 76 | $vocabulary = array( |
---|
| 77 | 'name' => t('Beneficiarios'), |
---|
| 78 | 'multiple' => 0, |
---|
| 79 | 'required' => 0, |
---|
| 80 | 'hierarchy' => 1, |
---|
| 81 | 'relations' => 0, |
---|
| 82 | 'module' => 'proyectos_operativos_extra', |
---|
| 83 | 'weight' => -10, |
---|
| 84 | ); |
---|
| 85 | taxonomy_save_vocabulary($vocabulary); |
---|
| 86 | variable_set('proyectos_operativos_extra_bene', $vocabulary['vid']); |
---|
| 87 | _proyectos_operativos_extra_agregar_beneficiario($vocabulary['vid']); |
---|
| 88 | } |
---|
| 89 | $vocabulary = taxonomy_vocabulary_load(variable_get('proyectos_operativos_extra_partacc', 0)); |
---|
| 90 | if (!$vocabulary) { |
---|
| 91 | $vocabulary = array( |
---|
| 92 | 'name' => t('Partidas AE'), |
---|
| 93 | 'multiple' => 0, |
---|
| 94 | 'required' => 0, |
---|
| 95 | 'hierarchy' => 1, |
---|
| 96 | 'relations' => 0, |
---|
| 97 | 'module' => 'proyectos_operativos_extra', |
---|
| 98 | 'weight' => -10, |
---|
| 99 | ); |
---|
| 100 | taxonomy_save_vocabulary($vocabulary); |
---|
| 101 | variable_set('proyectos_operativos_extra_partacc', $vocabulary['vid']); |
---|
| 102 | _proyectos_operativos_extra_agregar_partida_acciones($vocabulary['vid']); |
---|
| 103 | } |
---|
| 104 | $vocabulary = taxonomy_vocabulary_load(variable_get('proyectos_operativos_extra_entidad', 0)); |
---|
| 105 | if (!$vocabulary) { |
---|
| 106 | $vocabulary = array( |
---|
| 107 | 'name' => t('Paises'), |
---|
| 108 | 'multiple' => 0, |
---|
| 109 | 'required' => 0, |
---|
| 110 | 'hierarchy' => 1, |
---|
| 111 | 'relations' => 0, |
---|
| 112 | 'module' => 'proyectos_operativos_extra', |
---|
| 113 | 'weight' => -10, |
---|
| 114 | ); |
---|
| 115 | taxonomy_save_vocabulary($vocabulary); |
---|
| 116 | variable_set('proyectos_operativos_extra_entidad', $vocabulary['vid']); |
---|
| 117 | _proyectos_operativos_extra_agregar_entidades($vocabulary['vid']); |
---|
| 118 | } |
---|
| 119 | $vocabulary = taxonomy_vocabulary_load(variable_get('proyectos_operativos_pdlp1', 0)); |
---|
| 120 | if (!$vocabulary) { |
---|
| 121 | $vocabulary = array( |
---|
| 122 | 'name' => t('Plan de la Patria1'), |
---|
| 123 | 'multiple' => 0, |
---|
| 124 | 'required' => 0, |
---|
| 125 | 'hierarchy' => 1, |
---|
| 126 | 'relations' => 0, |
---|
| 127 | 'module' => 'proyectos_operativos_extra', |
---|
| 128 | 'weight' => -10, |
---|
| 129 | ); |
---|
| 130 | taxonomy_save_vocabulary($vocabulary); |
---|
| 131 | variable_set('proyectos_operativos_pdlp1', $vocabulary['vid']); |
---|
| 132 | _proyectos_operativos_extra_agregar_pdlp($vocabulary['vid']); |
---|
| 133 | } |
---|
| 134 | } |
---|