source: sipes/0.3-modules/proyectos_operativos_seguimiento/includes/accion_especifica_de_proyecto_seguimiento.admin.inc @ 74e53ef

stable
Last change on this file since 74e53ef was dac13f8, checked in by Sipes Apn <root@…>, 7 años ago

se agrego la funcion de administracion

  • Propiedad mode establecida a 100755
File size: 13.3 KB
Línea 
1<?php
2
3  /**
4  * Sistema Integral de Planificación y Presupuesto (SIPP)
5  * @file accion_especifica_de_proyecto_seguimiento.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 - Ing Diego Uzcategui
24  * @date 2013-03-01 // (a&#241;o-mes-dia)
25  * @version 0.1 // (0.1)
26  *
27  */
28
29/*
30 * ente_planificador_admin_settings
31 * Configurar seguimiento proyecto y sus acciones
32 */
33function accion_especifica_de_proyecto_seguimiento_admin_settings() {
34  $ftypes = array(
35    0 => t('Seleccione'),
36    '1' => t('January'),
37    '2' => t('February'),
38    '3' => t('March'),
39    '4' => t('April'),
40    '5' => t('May'),
41    '6' => t('June'),
42    '7' => t('July'),
43    '8' => t('August'),
44    '9' => t('September'),
45    '10' => t('Octuber'),
46    '11' => t('November'),
47    '12' => t('December'),
48  );
49  $current_year = date("Y") + 1;
50  if (!variable_get('accion_especifica_de_proyecto_seguimiento_anho_creacion', 0)) {
51  $years[0] = t('Seleccione');
52  }
53  for($i = $current_year - 10; $i <= $current_year; $i++) {
54    $years[$i] = $i;
55  }
56  for($i = 1; $i <= 12; $i++) {
57    $opciones[] = $i;
58  }
59  $form = array();
60  $form['days'] = array(
61    '#type' => 'fieldset',
62    '#title' => t('Fechas'),
63    '#collapsible' => TRUE,
64    '#collapsed' => FALSE,
65  );
66  /*
67  $form['days']['accion_especifica_de_proyecto_seguimiento_anho_creacion'] = array(
68    '#title' => t('Gestionar proyectos para el año'),
69    '#type' => 'select',
70    '#default_value' => variable_get('accion_especifica_de_proyecto_seguimiento_anho_creacion', 0),
71    '#options' => $years,
72  );
73  */
74  $form['days']['seguimiento'] = array(
75    '#type' => 'fieldset',
76    '#title' => t('Seguimiento de Proyectos y sus Acciones Especificas'),
77    '#collapsible' => TRUE,
78    '#collapsed' => FALSE,
79  );
80  $form['days']['seguimiento']['accion_especifica_de_proyecto_seguimiento_mes_seguimiento'] = array(
81    '#title' => t('Indique el mes Inicial para dar comienzo al seguimiento de los proyectos'),
82    '#type' => 'select',
83    '#default_value' => variable_get('accion_especifica_de_proyecto_seguimiento_mes_seguimiento', 0),
84    '#options' => $ftypes,
85  );
86  $ftypes2 = $ftypes;
87  unset($ftypes2[0]);
88  $form['days']['seguimiento']['seguimiento_proyectos_cantidad_meses_seguimiento'] = array(
89    '#title' => t('Habilitar meses para realizar el segumiento'),
90    '#type' => 'checkboxes',
91    '#default_value' => variable_get('seguimiento_proyectos_cantidad_meses_seguimiento', 1),
92    '#options' => $ftypes2,
93  );
94  $form['days']['seguimiento']['accion_especifica_de_proyecto_seguimiento_anho_seguimiento'] = array(
95    '#title' => t('Habilitar seguimiento para el año'),
96    '#type' => 'select',
97    '#default_value' => variable_get('accion_especifica_de_proyecto_seguimiento_anho_seguimiento', 0),
98    '#options' => $years,
99  );
100  $form['days']['seguimiento']['accion_especifica_de_proyecto_seguimiento_aesep'] = array(
101    '#type' => 'checkbox',
102    '#title' => t('Seguimiento de AE por separado'),
103    '#description' => t('Permitir el seguimiento de las AE con un flujo de trabajo separado de los proyectos'),
104    '#default_value' => variable_get('accion_especifica_de_proyecto_seguimiento_aesep', 0),
105  );
106
107  $form['visual'] = array(
108    '#type' => 'fieldset',
109    '#title' => t('Visualización'),
110    '#collapsible' => TRUE,
111    '#collapsed' => FALSE,
112  );
113  //estado critico
114  $form['visual']['critico'] = array(
115    '#type' => 'fieldset',
116    '#title' => t('Estado critico'),
117    '#collapsible' => TRUE,
118    '#collapsed' => FALSE,
119  );
120  $form['visual']['critico']['accion_especifica_de_proyecto_seguimiento_color_critica'] = array(
121    '#title' => t('Color de fondo'),
122    '#type' => 'textfield',
123    '#default_value' => variable_get('accion_especifica_de_proyecto_seguimiento_color_critica', '#fd0002'),
124    '#required' => TRUE,
125    '#size' => 10,
126  );
127  $form['visual']['critico']['accion_especifica_de_proyecto_seguimiento_colort_critica'] = array(
128    '#title' => t('Color de fuente'),
129    '#type' => 'textfield',
130    '#default_value' => variable_get('accion_especifica_de_proyecto_seguimiento_colort_critica', '#FFFFFF'),
131    '#required' => TRUE,
132    '#size' => 10,
133  );
134  $form['visual']['critico']['accion_especifica_de_proyecto_seguimiento_texto_critica'] = array(
135    '#title' => t('Texto a mostrar'),
136    '#type' => 'textfield',
137    '#default_value' => variable_get('accion_especifica_de_proyecto_seguimiento_texto_critica', 'Zona crítica'),
138    '#required' => TRUE,
139  );
140  // estado discreta
141  $form['visual']['discreta'] = array(
142    '#type' => 'fieldset',
143    '#title' => t('Estado discreto'),
144    '#collapsible' => TRUE,
145    '#collapsed' => FALSE,
146  );
147  $form['visual']['discreta']['accion_especifica_de_proyecto_seguimiento_color_discreta'] = array(
148    '#title' => t('Color de fondo'),
149    '#type' => 'textfield',
150    '#default_value' => variable_get('accion_especifica_de_proyecto_seguimiento_color_discreta', '#cc6733'),
151    '#required' => TRUE,
152    '#size' => 10,
153  );
154  $form['visual']['discreta']['accion_especifica_de_proyecto_seguimiento_colort_discreta'] = array(
155    '#title' => t('Color de fuente'),
156    '#type' => 'textfield',
157    '#default_value' => variable_get('accion_especifica_de_proyecto_seguimiento_colort_discreta', '#FFFFFF'),
158    '#required' => TRUE,
159    '#size' => 10,
160  );
161  $form['visual']['discreta']['accion_especifica_de_proyecto_seguimiento_texto_discreta'] = array(
162    '#title' => t('Texto a mostrar'),
163    '#type' => 'textfield',
164    '#default_value' => variable_get('accion_especifica_de_proyecto_seguimiento_texto_discreta', 'Zona discreta'),
165    '#required' => TRUE,
166  );
167  // estado moderada
168  $form['visual']['moderada'] = array(
169    '#type' => 'fieldset',
170    '#title' => t('Estado moderado'),
171    '#collapsible' => TRUE,
172    '#collapsed' => FALSE,
173  );
174  $form['visual']['moderada']['accion_especifica_de_proyecto_seguimiento_color_moderada'] = array(
175    '#title' => t('Color de fondo'),
176    '#type' => 'textfield',
177    '#default_value' => variable_get('accion_especifica_de_proyecto_seguimiento_color_moderada', '#fdff00'),
178    '#required' => TRUE,
179    '#size' => 10,
180  );
181  $form['visual']['moderada']['accion_especifica_de_proyecto_seguimiento_colort_moderada'] = array(
182    '#title' => t('Color de fuente'),
183    '#type' => 'textfield',
184    '#default_value' => variable_get('accion_especifica_de_proyecto_seguimiento_colort_moderada', '#000000'),
185    '#required' => TRUE,
186    '#size' => 10,
187  );
188  $form['visual']['moderada']['accion_especifica_de_proyecto_seguimiento_texto_moderada'] = array(
189    '#title' => t('Texto a mostrar'),
190    '#type' => 'textfield',
191    '#default_value' => variable_get('accion_especifica_de_proyecto_seguimiento_texto_moderada', 'Zona moderada'),
192    '#required' => TRUE,
193  );
194  // estado optima
195  $form['visual']['optima'] = array(
196    '#type' => 'fieldset',
197    '#title' => t('Estado Optimo'),
198    '#collapsible' => TRUE,
199    '#collapsed' => FALSE,
200  );
201  $form['visual']['optima']['accion_especifica_de_proyecto_seguimiento_color_optima'] = array(
202    '#title' => t('Color de fondo'),
203    '#type' => 'textfield',
204    '#default_value' => variable_get('accion_especifica_de_proyecto_seguimiento_color_optima', '#20ff21'),
205    '#required' => TRUE,
206    '#size' => 10,
207  );
208  $form['visual']['optima']['accion_especifica_de_proyecto_seguimiento_colort_optima'] = array(
209    '#title' => t('Color de fuente'),
210    '#type' => 'textfield',
211    '#default_value' => variable_get('accion_especifica_de_proyecto_seguimiento_colort_optima', '#000000'),
212    '#required' => TRUE,
213    '#size' => 10,
214  );
215  $form['visual']['optima']['accion_especifica_de_proyecto_seguimiento_texto_optima'] = array(
216    '#title' => t('Texto a mostrar'),
217    '#type' => 'textfield',
218    '#default_value' => variable_get('accion_especifica_de_proyecto_seguimiento_texto_optima', 'Zona optima'),
219    '#required' => TRUE,
220  );
221  // estado sejecucion
222  $form['visual']['sejecucion'] = array(
223    '#type' => 'fieldset',
224    '#title' => t('Estado Sobre ejecución'),
225    '#collapsible' => TRUE,
226    '#collapsed' => FALSE,
227  );
228  $form['visual']['sejecucion']['accion_especifica_de_proyecto_seguimiento_color_sejecucion'] = array(
229    '#title' => t('Color de fondo'),
230    '#type' => 'textfield',
231    '#default_value' => variable_get('accion_especifica_de_proyecto_seguimiento_color_sejecucion', '#9966cd'),
232    '#required' => TRUE,
233    '#size' => 10,
234  );
235  $form['visual']['sejecucion']['accion_especifica_de_proyecto_seguimiento_colort_sejecucion'] = array(
236    '#title' => t('Color de fuente'),
237    '#type' => 'textfield',
238    '#default_value' => variable_get('accion_especifica_de_proyecto_seguimiento_colort_sejecucion', '#000000'),
239    '#required' => TRUE,
240    '#size' => 10,
241  );
242  $form['visual']['sejecucion']['accion_especifica_de_proyecto_seguimiento_texto_sejecucion'] = array(
243    '#title' => t('Texto a mostrar'),
244    '#type' => 'textfield',
245    '#default_value' => variable_get('accion_especifica_de_proyecto_seguimiento_texto_sejecucion', 'Sobre ejecución'),
246    '#required' => TRUE,
247  );
248  // estado sejecucion
249  $form['visual']['default'] = array(
250    '#type' => 'fieldset',
251    '#title' => t('Estado sin planificación'),
252    '#collapsible' => TRUE,
253    '#collapsed' => FALSE,
254  );
255  $form['visual']['default']['accion_especifica_de_proyecto_seguimiento_color_default'] = array(
256    '#title' => t('Color de fondo'),
257    '#type' => 'textfield',
258    '#default_value' => variable_get('accion_especifica_de_proyecto_seguimiento_color_default', '#633303'),
259    '#required' => TRUE,
260    '#size' => 10,
261  );
262  $form['visual']['default']['accion_especifica_de_proyecto_seguimiento_colort_default'] = array(
263    '#title' => t('Color de fuente'),
264    '#type' => 'textfield',
265    '#default_value' => variable_get('accion_especifica_de_proyecto_seguimiento_colort_default', '#FFFFFF'),
266    '#required' => TRUE,
267    '#size' => 10,
268  );
269  $form['visual']['default']['accion_especifica_de_proyecto_seguimiento_texto_default'] = array(
270    '#title' => t('Texto a mostrar'),
271    '#type' => 'textfield',
272    '#default_value' => variable_get('accion_especifica_de_proyecto_seguimiento_texto_default', 'No hay planificación'),
273    '#required' => TRUE,
274  );
275  if (module_exists('workflow')) {
276    $wid = workflow_get_workflow_for_type('proyectos_operativos');
277    if ($wid){
278      $form['workflow'] = array(
279        '#type' => 'fieldset',
280        '#title' => t('Flujo de trabajo'),
281        '#description' => t('Flujo de trabajo usado para modificar el seguimiento de los proyectos operativos'),
282      );
283      $states = workflow_get_states($wid);
284      $rids = user_roles();
285      $rids['-1'] = t('author');
286      if (count($states)) {
287        $form['workflow']['proyectos_operativos_state_seguimiento'] = array(
288          '#title' => t('Seleccione el estado de inicio cuando se añada un seguimiento'),
289          '#type' => 'select',
290          '#default_value' => variable_get('proyectos_operativos_state_seguimiento', 0),
291          '#options' => $states,
292          '#weight' => -6,
293        );
294      $form['workflow']['semaforo'] = array(
295        '#type' => 'fieldset',
296        '#title' => t('Semaforo'),
297        '#description' => t('Color del semaforo para los estados'),
298      );
299      $form['workflow']['semaforo']['proyectos_operativos_state_segu_sema_-1'] = array(
300        '#title' => t('Color del semaforo del seguimiento sin ingresar'),
301        '#type' => 'textfield',
302        '#default_value' => variable_get('proyectos_operativos_state_segu_sema_-1', '#000000'),
303        '#required' => TRUE,
304      );
305        foreach ($states as $sid => $state) {
306          $form['workflow']['semaforo']['proyectos_operativos_state_segu_sema_' . $sid] = array(
307            '#title' => t('Color del semaforo del estado @estado', array('@estado' => $state)),
308            '#type' => 'textfield',
309            '#default_value' => variable_get('proyectos_operativos_state_segu_sema_' . $sid, '#000000'),
310            '#required' => TRUE,
311          );
312          $form['workflow']['proyectos_operativos_state_s_' . $sid] = array(
313            '#type' => 'checkboxes',
314            '#options' => $rids,
315            '#default_value' => variable_get('proyectos_operativos_state_s_' . $sid, array()),
316            '#title' => t('Roles que pueden editar los seguimientos de los Proyectos Operativos'),
317            '#multiple' => TRUE,
318            '#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>',
319            '#suffix' => "</td></tr></tbody></table>",
320          );
321        }
322      }
323    }
324  }
325  return system_settings_form($form);
326}
Nota: Vea TracBrowser para ayuda de uso del navegador del repositorio.