t('Seleccione'), '1' => t('January'), '2' => t('February'), '3' => t('March'), '4' => t('April'), '5' => t('May'), '6' => t('June'), '7' => t('July'), '8' => t('August'), '9' => t('September'), '10' => t('Octuber'), '11' => t('November'), '12' => t('December'), ); $node_type = content_types('proyectos_operativos'); $fields = $node_type['fields']; $current_year = date("Y"); if (!variable_get('proyectos_operativos_anho_creacion', 0)) { $years[0] = t('Seleccione'); } for($i = $current_year - 10; $i <= $current_year + 10; $i++) { $years[$i] = $i; } $form = array(); $form['days'] = array( '#type' => 'fieldset', '#title' => t('Fechas'), '#collapsible' => TRUE, '#collapsed' => FALSE, ); $form['days']['proyectos_operativos_anho_creacion'] = array( '#title' => t('Gestionar los proyectos operativos para el año'), '#type' => 'select', '#default_value' => variable_get('proyectos_operativos_anho_creacion', 0), '#options' => $years, ); $form['days']['proyectos_operativos_anho_edit'] = array( '#title' => t('Permitir editar los proyectos operativos para los años'), '#type' => 'select', '#default_value' => variable_get('proyectos_operativos_anho_edit', array()), '#options' => $years, '#multiple' => TRUE, ); $form['days']['proyectos_operativos_perm_nuevos'] = array( '#type' => 'checkbox', '#title' => t('Permitir agregar nuevos proyectos.'), '#default_value' => variable_get('proyectos_operativos_perm_nuevos', TRUE), ); $entes = obtener_ente_planificador(); $form['days']['proyectos_operativos_add_entes'] = array( '#title' => t('Solo permitir agregar proyectos a estos entes'), '#type' => 'select', '#default_value' => variable_get('proyectos_operativos_add_entes', array()), '#options' => $entes, '#multiple' => 'TRUE', ); $form['days']['proyectos_operativos_perm_edit'] = array( '#type' => 'checkbox', '#title' => t('Permitir editar proyectos.'), '#default_value' => variable_get('proyectos_operativos_perm_edit', TRUE), ); $form['days']['proyectos_operativos_updt_entes'] = array( '#title' => t('Solo permitir modificar proyectos a estos entes'), '#type' => 'select', '#default_value' => variable_get('proyectos_operativos_updt_entes', array()), '#options' => $entes, '#multiple' => 'TRUE', ); $form['days']['proyectos_operativos_reformulacion_meses'] = array( '#type' => 'checkbox', '#title' => t('No Restringir agregar reformulación en los meses fuera de la fecha del proyecto.'), '#default_value' => variable_get('proyectos_operativos_reformulacion_meses', TRUE), ); $form['basicos'] = array( '#type' => 'fieldset', '#title' => t('Recolectar información en Datos Básicos del Proyecto Operativo'), '#collapsible' => TRUE, '#collapsed' => FALSE, ); $vid = $fields['field_proyecto_plurianual']['vid']; $tree = taxonomy_get_tree($vid); $option_plurianual = array(); if ($tree) { foreach ($tree as $term) { $choice = new stdClass(); $choice->option = array($term->tid => str_repeat('-', $term->depth) . $term->name); $option_plurianual[] = $choice; } } $form['basicos']['proyectos_operativos_plurianual'] = array( '#type' => 'select', '#options' => $option_plurianual, '#default_value' => variable_get('proyectos_operativos_plurianual', 0), '#title' => t('Proyecto Plurianual'), '#description' => t('Seleccione la opción de cuando un proyecto es considerado plurianual'), ); $form['basicos']['proyectos_operativos_muestra_pndes'] = array( '#type' => 'checkbox', '#title' => t('Recolectar PNDES.'), '#default_value' => variable_get('proyectos_operativos_muestra_pndes', TRUE), ); $form['basicos']['proyectos_operativos_muestra_mcti'] = array( '#type' => 'checkbox', '#title' => t('Recolectar Directriz MCTI.'), '#default_value' => variable_get('proyectos_operativos_muestra_mcti', TRUE), ); $form['basicos']['responsables'] = array( '#title' => t('Responsables del proyecto'), '#type' => 'fieldset', ); $form['basicos']['responsables']['proyectos_operativos_muestra_gerentes'] = array( '#type' => 'checkbox', '#title' => t('Gerente del Proyecto'), '#default_value' => variable_get('proyectos_operativos_muestra_gerentes', TRUE), ); $form['generales'] = array( '#type' => 'fieldset', '#title' => t('Recolectar información en Datos Generales del Proyecto Operativo'), '#collapsible' => TRUE, '#collapsed' => FALSE, ); $form['generales']['proyectos_operativos_muestra_talento'] = array( '#type' => 'checkbox', '#title' => t('Recolectar Talento humano.'), '#default_value' => variable_get('proyectos_operativos_muestra_talento', TRUE), ); $form['generales']['proyectos_operativos_muestra_capacidades'] = array( '#type' => 'checkbox', '#title' => t('Recolectar Capacidades.'), '#default_value' => variable_get('proyectos_operativos_muestra_capacidades', TRUE), ); $form['generales']['proyectos_operativos_muestra_beneficiario'] = array( '#type' => 'checkbox', '#title' => t('Recolectar Beneficiarios.'), '#default_value' => variable_get('proyectos_operativos_muestra_beneficiario', TRUE), ); $form['generales']['proyectos_operativos_muestra_beneficiarios_indirectos'] = array( '#type' => 'checkbox', '#title' => t('Recolectar Beneficiarios indirectos.'), '#default_value' => variable_get('proyectos_operativos_muestra_beneficiarios_indirectos', TRUE), ); $form['indicadores'] = array( '#type' => 'fieldset', '#title' => t('Recolectar información en Indicadores del Proyecto'), '#collapsible' => TRUE, '#collapsed' => FALSE, ); $form['indicadores']['proyectos_operativos_muestra_enunciado_problema'] = array( '#type' => 'checkbox', '#title' => t('Recolectar Enunciado del problema.'), '#default_value' => variable_get('proyectos_operativos_muestra_enunciado_problema', TRUE), ); $form['indicadores']['proyectos_operativos_muestra_justicacion'] = array( '#type' => 'checkbox', '#title' => t('Recolectar Justificación.'), '#default_value' => variable_get('proyectos_operativos_muestra_justicacion', TRUE), ); $form['indicadores']['proyectos_operativos_muestra_alcance'] = array( '#type' => 'checkbox', '#title' => t('Recolectar Alcance.'), '#default_value' => variable_get('proyectos_operativos_muestra_alcance', TRUE), ); $form['indicadores']['proyectos_operativos_muestra_sa'] = array( '#type' => 'checkbox', '#title' => t('Recolectar Situación Actual.'), '#default_value' => variable_get('proyectos_operativos_muestra_sa', TRUE), ); $form['indicadores']['proyectos_operativos_muestra_sa_cuantificacion'] = array( '#type' => 'checkbox', '#title' => t('Recolectar Cuantificación en Situación Actual.'), '#default_value' => variable_get('proyectos_operativos_muestra_sa_cuantificacion', TRUE), ); $form['indicadores']['proyectos_operativos_muestra_so'] = array( '#type' => 'checkbox', '#title' => t('Recolectar Situación Objetivo.'), '#default_value' => variable_get('proyectos_operativos_muestra_so', TRUE), ); $vid = $fields['field_proyecto_unidadm']['vid']; $tree = taxonomy_get_tree($vid); $option_unidadm = array(); if ($tree) { foreach ($tree as $term) { $choice = new stdClass(); $choice->option = array($term->tid => str_repeat('-', $term->depth) . $term->name); $option_unidadm[] = $choice; } } $form['indicadores']['proyectos_operativos_allow_unidpersona'] = array( '#type' => 'select', '#options' => $option_unidadm, '#default_value' => variable_get('proyectos_operativos_allow_unidpersona', array()), '#title' => t('Campos de las unidades de medida que deben relacionarse con personas'), '#multiple' => TRUE, ); $form['format_number'] = array( '#type' => 'fieldset', '#title' => t('Formato Númerico'), '#collapsible' => TRUE, '#collapsed' => FALSE, ); $form['format_number']['proyectos_operativos_number_demostracion'] = array( '#value' => '' . 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', '.')))) . '', '#weight' => -10, ); $form['format_number']['proyectos_operativos_number_decimals'] = array( '#type' => 'textfield', '#title' => t('Cantidad de Decimales.'), '#required' => TRUE, '#weight' => -9, '#default_value' => variable_get('proyectos_operativos_number_decimals', 0), ); $form['format_number']['proyectos_operativos_number_dec_point'] = array( '#type' => 'textfield', '#title' => t('Separador Decimal.'), '#required' => TRUE, '#weight' => -9, '#default_value' => variable_get('proyectos_operativos_number_dec_point', ','), ); $form['format_number']['proyectos_operativos_number_thousands_sep'] = array( '#type' => 'textfield', '#title' => t('Separador de Miles.'), '#required' => TRUE, '#weight' => -9, '#default_value' => variable_get('proyectos_operativos_number_thousands_sep', '.'), ); return system_settings_form($form); } /** * Implementation of proyectos_operativos_admin_settings(). * COnfigurar proyectos operativos. */ function proyectos_operativos_admin_workflow_settings() { if (module_exists('workflow')) { $wid = workflow_get_workflow_for_type('proyectos_operativos'); if ($wid){ $states = workflow_get_states($wid); $rids = user_roles(); $rids['-1'] = t('author'); if (count($states)) { $form['workflow'] = array( '#type' => 'fieldset', '#title' => t('Workflow'), '#collapsible' => TRUE, '#collapsed' => FALSE, ); foreach ($states as $sid => $state) { $form['workflow']['proyectos_operativos_state_m_' . $sid] = array( '#type' => 'checkboxes', '#options' => $rids, '#default_value' => variable_get('proyectos_operativos_state_m_' . $sid, array()), '#title' => t('Roles que pueden editar los Proyectos Operativos'), '#multiple' => TRUE, '#prefix' => '
' . t('State: @state', array('@state' => $state)) . '
', '#suffix' => "
", ); } $form['seguimiento']['proyectos_operativos_state_aprobado'] = array( '#type' => 'select', '#title' => t('Estado aprobado'), '#default_value' => variable_get('proyectos_operativos_state_aprobado', NULL), '#options' => $states, '#prefix' => '
', ); $form['seguimiento']['proyectos_operativos_state_naprobado'] = array( '#type' => 'select', '#title' => t('Estado no aprobado'), '#default_value' => variable_get('proyectos_operativos_state_naprobado', NULL), '#options' => $states, '#prefix' => "", '#suffix' => "
", ); } $form['workflow']['devueltos'] = array( '#type' => 'fieldset', '#title' => t('Estados Devueltos'), '#collapsible' => TRUE, '#collapsed' => FALSE, ); $i = 0; $first_state = _workflow_creation_state($wid); $prefijo = ''; $prefijo .= ''; foreach ($states as $sid => $state) { if ($sid != $first_state) { $prefijo .= ''; } } $prefijo .= ''; foreach ($states as $sid => $state) { $prefijo .= ''; $prefijo .= ''; foreach ($states as $sid1 => $state1) { if ($sid1 != $first_state) { $form['workflow']['devueltos']['proyectos_operativos_state_d_' . $sid . '_' . $sid1] = array( '#type' => 'checkbox', '#title' => check_plain($state1), '#default_value' => variable_get('proyectos_operativos_state_d_' . $sid . '_' . $sid1, FALSE), '#prefix' => $prefijo . '", ); $prefijo = ''; } } $form['workflow']['devueltos']['proyectos_operativos_state_d_' . $sid . '_' . $sid1]['#suffix'] .= ''; } $form['workflow']['devueltos']['proyectos_operativos_state_d_' . $sid . '_' . $sid1]['#suffix'] .= '
' . t('De / A') . ' →' . $state . '
' . check_plain($state) . '', '#suffix' => "
'; $form['workflow']['devueltos']['proyectos_operativos_state_tdevueltos'] = array( '#type' => 'textfield', '#title' => t('Texto que antecede a los estados devueltos.'), '#required' => TRUE, '#default_value' => variable_get('proyectos_operativos_state_tdevueltos', 'Devuelto a @state'), '#description' => t('Añada la etiqueta @state para indicar donde debe aparecer la palabra del estado.'), ); $form['workflow']['devueltos']['proyectos_operativos_state_tndevueltos'] = array( '#type' => 'textfield', '#title' => t('Texto que antecede a los estados no devueltos.'), '#required' => TRUE, '#default_value' => variable_get('proyectos_operativos_state_tndevueltos', 'Enviado a @state'), '#description' => t('Añada la etiqueta @state para indicar donde debe aparecer la palabra del estado.'), ); } } return system_settings_form($form); }