1 | <?php |
---|
2 | |
---|
3 | /** |
---|
4 | * Sistema Integral de Planificación y Presupuesto (SIPP) |
---|
5 | * @file proyectos_operativos.admin.inc |
---|
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 | * @date 2013-08-27 // (año-mes-dia) |
---|
26 | * @version 0.1 // (0.1) |
---|
27 | * |
---|
28 | */ |
---|
29 | |
---|
30 | /** |
---|
31 | * Implementation of proyectos_operativos_admin_settings(). |
---|
32 | * COnfigurar proyectos operativos. |
---|
33 | */ |
---|
34 | function proyectos_operativos_admin_settings() { |
---|
35 | $ftypes = array( |
---|
36 | 0 => t('Seleccione'), |
---|
37 | '1' => t('January'), |
---|
38 | '2' => t('February'), |
---|
39 | '3' => t('March'), |
---|
40 | '4' => t('April'), |
---|
41 | '5' => t('May'), |
---|
42 | '6' => t('June'), |
---|
43 | '7' => t('July'), |
---|
44 | '8' => t('August'), |
---|
45 | '9' => t('September'), |
---|
46 | '10' => t('Octuber'), |
---|
47 | '11' => t('November'), |
---|
48 | '12' => t('December'), |
---|
49 | ); |
---|
50 | $current_year = date("Y"); |
---|
51 | if (!variable_get('proyectos_operativos_anho_creacion', 0)) { |
---|
52 | $years[0] = t('Seleccione'); |
---|
53 | } |
---|
54 | for($i = $current_year - 10; $i <= $current_year; $i++) { |
---|
55 | $years[$i] = $i; |
---|
56 | } |
---|
57 | $form = array(); |
---|
58 | $form['days'] = array( |
---|
59 | '#type' => 'fieldset', |
---|
60 | '#title' => t('Fechas'), |
---|
61 | '#collapsible' => TRUE, |
---|
62 | '#collapsed' => FALSE, |
---|
63 | ); |
---|
64 | $form['days']['proyectos_operativos_anho_creacion'] = array( |
---|
65 | '#title' => t('Gestionar los proyectos operativos para el año'), |
---|
66 | '#type' => 'select', |
---|
67 | '#default_value' => variable_get('proyectos_operativos_anho_creacion', 0), |
---|
68 | '#options' => $years, |
---|
69 | ); |
---|
70 | $form['days']['proyectos_operativos_reformulacion_meses'] = array( |
---|
71 | '#type' => 'checkbox', |
---|
72 | '#title' => t('No Restringir agregar reformulación en los meses fuera de la fecha del proyecto.'), |
---|
73 | '#default_value' => variable_get('proyectos_operativos_reformulacion_meses', TRUE), |
---|
74 | ); |
---|
75 | $form['basicos'] = array( |
---|
76 | '#type' => 'fieldset', |
---|
77 | '#title' => t('Recolectar información en Datos Básicos del Proyecto Operativo'), |
---|
78 | '#collapsible' => TRUE, |
---|
79 | '#collapsed' => FALSE, |
---|
80 | ); |
---|
81 | $form['basicos']['proyectos_operativos_muestra_pndes'] = array( |
---|
82 | '#type' => 'checkbox', |
---|
83 | '#title' => t('Recolectar PNDES.'), |
---|
84 | '#default_value' => variable_get('proyectos_operativos_muestra_pndes', TRUE), |
---|
85 | ); |
---|
86 | $form['basicos']['proyectos_operativos_muestra_mcti'] = array( |
---|
87 | '#type' => 'checkbox', |
---|
88 | '#title' => t('Recolectar Directriz MCTI.'), |
---|
89 | '#default_value' => variable_get('proyectos_operativos_muestra_mcti', TRUE), |
---|
90 | ); |
---|
91 | $form['generales'] = array( |
---|
92 | '#type' => 'fieldset', |
---|
93 | '#title' => t('Recolectar información en Datos Generales del Proyecto Operativo'), |
---|
94 | '#collapsible' => TRUE, |
---|
95 | '#collapsed' => FALSE, |
---|
96 | ); |
---|
97 | $form['generales']['proyectos_operativos_muestra_talento'] = array( |
---|
98 | '#type' => 'checkbox', |
---|
99 | '#title' => t('Recolectar Talento humano.'), |
---|
100 | '#default_value' => variable_get('proyectos_operativos_muestra_talento', TRUE), |
---|
101 | ); |
---|
102 | $form['generales']['proyectos_operativos_muestra_capacidades'] = array( |
---|
103 | '#type' => 'checkbox', |
---|
104 | '#title' => t('Recolectar Capacidades.'), |
---|
105 | '#default_value' => variable_get('proyectos_operativos_muestra_capacidades', TRUE), |
---|
106 | ); |
---|
107 | $form['generales']['proyectos_operativos_muestra_beneficiario'] = array( |
---|
108 | '#type' => 'checkbox', |
---|
109 | '#title' => t('Recolectar Beneficiarios.'), |
---|
110 | '#default_value' => variable_get('proyectos_operativos_muestra_beneficiario', TRUE), |
---|
111 | ); |
---|
112 | $form['generales']['proyectos_operativos_muestra_beneficiarios_indirectos'] = array( |
---|
113 | '#type' => 'checkbox', |
---|
114 | '#title' => t('Recolectar Beneficiarios indirectos.'), |
---|
115 | '#default_value' => variable_get('proyectos_operativos_muestra_beneficiarios_indirectos', TRUE), |
---|
116 | ); |
---|
117 | $form['generales']['proyectos_operativos_muestra_empleos_indirectos'] = array( |
---|
118 | '#type' => 'checkbox', |
---|
119 | '#title' => t('Recolectar Empleos indirectos.'), |
---|
120 | '#default_value' => variable_get('proyectos_operativos_muestra_empleos_indirectos', TRUE), |
---|
121 | ); |
---|
122 | $form['indicadores'] = array( |
---|
123 | '#type' => 'fieldset', |
---|
124 | '#title' => t('Recolectar información en Indicadores del Proyecto'), |
---|
125 | '#collapsible' => TRUE, |
---|
126 | '#collapsed' => FALSE, |
---|
127 | ); |
---|
128 | $form['indicadores']['proyectos_operativos_muestra_enunciado_problema'] = array( |
---|
129 | '#type' => 'checkbox', |
---|
130 | '#title' => t('Recolectar Enunciado del problema.'), |
---|
131 | '#default_value' => variable_get('proyectos_operativos_muestra_enunciado_problema', TRUE), |
---|
132 | ); |
---|
133 | $form['indicadores']['proyectos_operativos_muestra_justicacion'] = array( |
---|
134 | '#type' => 'checkbox', |
---|
135 | '#title' => t('Recolectar Justificación.'), |
---|
136 | '#default_value' => variable_get('proyectos_operativos_muestra_justicacion', TRUE), |
---|
137 | ); |
---|
138 | $form['indicadores']['proyectos_operativos_muestra_alcance'] = array( |
---|
139 | '#type' => 'checkbox', |
---|
140 | '#title' => t('Recolectar Alcance.'), |
---|
141 | '#default_value' => variable_get('proyectos_operativos_muestra_alcance', TRUE), |
---|
142 | ); |
---|
143 | $form['indicadores']['proyectos_operativos_muestra_sa'] = array( |
---|
144 | '#type' => 'checkbox', |
---|
145 | '#title' => t('Recolectar Situación Actual.'), |
---|
146 | '#default_value' => variable_get('proyectos_operativos_muestra_sa', TRUE), |
---|
147 | ); |
---|
148 | $form['indicadores']['proyectos_operativos_muestra_sa_cuantificacion'] = array( |
---|
149 | '#type' => 'checkbox', |
---|
150 | '#title' => t('Recolectar Cuantificación en Situación Actual.'), |
---|
151 | '#default_value' => variable_get('proyectos_operativos_muestra_sa_cuantificacion', TRUE), |
---|
152 | ); |
---|
153 | |
---|
154 | $form['indicadores']['proyectos_operativos_muestra_so'] = array( |
---|
155 | '#type' => 'checkbox', |
---|
156 | '#title' => t('Recolectar Situación Objetivo.'), |
---|
157 | '#default_value' => variable_get('proyectos_operativos_muestra_so', TRUE), |
---|
158 | ); |
---|
159 | |
---|
160 | $form['format_number'] = array( |
---|
161 | '#type' => 'fieldset', |
---|
162 | '#title' => t('Formato Númerico'), |
---|
163 | '#collapsible' => TRUE, |
---|
164 | '#collapsed' => FALSE, |
---|
165 | ); |
---|
166 | $form['format_number']['proyectos_operativos_number_demostracion'] = array( |
---|
167 | '#value' => '<b>' . t('Convertir número @numero en @numero_conversion', array('@numero' => '4123123.23', '@numero_conversion' => number_format(4123123.23, variable_get('proyectos_operativos_number_decimals', 0), variable_get('proyectos_operativos_number_dec_point', ','), variable_get('proyectos_operativos_number_thousands_sep', '.')))) . '</b>', |
---|
168 | '#weight' => -10, |
---|
169 | |
---|
170 | ); |
---|
171 | $form['format_number']['proyectos_operativos_number_decimals'] = array( |
---|
172 | '#type' => 'textfield', |
---|
173 | '#title' => t('Cantidad de Decimales.'), |
---|
174 | '#required' => TRUE, |
---|
175 | '#weight' => -9, |
---|
176 | '#default_value' => variable_get('proyectos_operativos_number_decimals', 0), |
---|
177 | ); |
---|
178 | $form['format_number']['proyectos_operativos_number_dec_point'] = array( |
---|
179 | '#type' => 'textfield', |
---|
180 | '#title' => t('Separador Decimal.'), |
---|
181 | '#required' => TRUE, |
---|
182 | '#weight' => -9, |
---|
183 | '#default_value' => variable_get('proyectos_operativos_number_dec_point', ','), |
---|
184 | ); |
---|
185 | $form['format_number']['proyectos_operativos_number_thousands_sep'] = array( |
---|
186 | '#type' => 'textfield', |
---|
187 | '#title' => t('Separador de Miles.'), |
---|
188 | '#required' => TRUE, |
---|
189 | '#weight' => -9, |
---|
190 | '#default_value' => variable_get('proyectos_operativos_number_thousands_sep', '.'), |
---|
191 | ); |
---|
192 | |
---|
193 | if (module_exists('workflow')) { |
---|
194 | $wid = workflow_get_workflow_for_type('proyectos_operativos'); |
---|
195 | if ($wid){ |
---|
196 | $states = workflow_get_states($wid); |
---|
197 | $rids = user_roles(); |
---|
198 | $rids['-1'] = t('author'); |
---|
199 | if (count($states)) { |
---|
200 | $form['workflow'] = array( |
---|
201 | '#type' => 'fieldset', |
---|
202 | '#title' => t('Workflow'), |
---|
203 | '#collapsible' => TRUE, |
---|
204 | '#collapsed' => FALSE, |
---|
205 | ); |
---|
206 | foreach ($states as $sid => $state) { |
---|
207 | $form['workflow']['proyectos_operativos_state_m_' . $sid] = array( |
---|
208 | '#type' => 'checkboxes', |
---|
209 | '#options' => $rids, |
---|
210 | '#default_value' => variable_get('proyectos_operativos_state_m_' . $sid, array()), |
---|
211 | '#title' => t('Roles que pueden editar los Proyectos Operativos'), |
---|
212 | '#multiple' => TRUE, |
---|
213 | '#prefix' => '<table width="100%" style="border: 0;"><tbody style="border: 0;"><tr><th colspan="3">' . t('State: @state', array('@state' => $state)) . '</th></tr><tr><td>', |
---|
214 | '#suffix' => "</td></tr></tbody></table>", |
---|
215 | ); |
---|
216 | } |
---|
217 | $form['seguimiento']['proyectos_operativos_state_aprobado'] = array( |
---|
218 | '#type' => 'select', |
---|
219 | '#title' => t('Estado aprobado'), |
---|
220 | '#default_value' => variable_get('proyectos_operativos_state_aprobado', NULL), |
---|
221 | '#options' => $states, |
---|
222 | '#prefix' => '<table width="100%" style="border: 0;"><tbody style="border: 0;"><tr><td>', |
---|
223 | ); |
---|
224 | $form['seguimiento']['proyectos_operativos_state_naprobado'] = array( |
---|
225 | '#type' => 'select', |
---|
226 | '#title' => t('Estado no aprobado'), |
---|
227 | '#default_value' => variable_get('proyectos_operativos_state_naprobado', NULL), |
---|
228 | '#options' => $states, |
---|
229 | '#prefix' => "</td><td>", |
---|
230 | '#suffix' => "</td></tr></tbody></table>", |
---|
231 | ); |
---|
232 | } |
---|
233 | } |
---|
234 | } |
---|
235 | return system_settings_form($form); |
---|
236 | } |
---|
237 | |
---|
238 | /** |
---|
239 | * Implementation of proyectos_operativos_admin_settings(). |
---|
240 | * COnfigurar proyectos operativos. |
---|
241 | */ |
---|
242 | function proyectos_operativos_admin_workflow_color_settings() { |
---|
243 | if (module_exists('workflow')) { |
---|
244 | $wid = workflow_get_workflow_for_type('proyectos_operativos'); |
---|
245 | $colores = '#ffffff'; |
---|
246 | if ($wid){ |
---|
247 | $states = workflow_get_states($wid); |
---|
248 | if (count($states)) { |
---|
249 | $form['workflow'] = array( |
---|
250 | '#type' => 'fieldset', |
---|
251 | '#title' => t('Workflow Status Color'), |
---|
252 | '#collapsible' => TRUE, |
---|
253 | '#collapsed' => FALSE, |
---|
254 | ); |
---|
255 | foreach ($states as $sid => $state) { |
---|
256 | $form['workflow']['proyectos_operativos_state_color_' . $sid] = array( |
---|
257 | '#type' => 'textfield', |
---|
258 | '#title' => t('Color para el Estado: '. $state), |
---|
259 | '#default_value' => variable_get('proyectos_operativos_state_color_' . $sid, $colores), |
---|
260 | '#size' => 25, |
---|
261 | ); |
---|
262 | } |
---|
263 | } |
---|
264 | } |
---|
265 | } |
---|
266 | return system_settings_form($form); |
---|
267 | } |
---|