'id_seg', 'title' => t('Seguimiento de Proyectos Operativos'), 'help' => t("Permite consultar el seguimiento de proyectos operativos."), ); // For other base tables, explain how we join $data['seguimiento_proyecto']['table']['join'] = array( // Directly links to node table. 'node' => array( 'left_field' => 'nid', 'field' => 'nid', ), 'users' => array( 'left_field' => 'uid', 'field' => 'uid', ), ); // id_seg $data['seguimiento_proyecto']['id_seg'] = array( 'title' => t('Id_seg'), 'help' => t('The ID of seguimiento.'), // The help that appears on the UI, // Information for displaying the nid 'field' => array( 'handler' => 'views_handler_field_node', 'click sortable' => TRUE, ), // Information for accepting a nid as an argument 'argument' => array( 'handler' => 'views_handler_argument_numeric', ), // Information for accepting a nid as a filter 'filter' => array( 'handler' => 'views_handler_filter_numeric', ), // Information for sorting on a nid. 'sort' => array( 'handler' => 'views_handler_sort', ), ); //nid $data['seguimiento_proyecto']['nid'] = array( 'title' => t('Nid del Proyecto.'), 'help' => t('Nid del Proyecto.'), 'relationship' => array( 'base' => 'node', 'base field' => 'nid', 'field' => 'nid', 'handler' => 'views_handler_relationship', 'label' => t('Nid Proyecto'), ), 'field' => array( 'handler' => 'views_handler_field', ), 'sort' => array( 'handler' => 'views_handler_sort', ), ); // uid field for seguimiento $data['seguimiento_proyecto']['uid'] = array( 'title' => t('User'), 'help' => t('Relate a seguimiento to the user who created the revision.'), 'relationship' => array( 'handler' => 'views_handler_relationship', 'base' => 'users', 'field' => 'uid', 'label' => t('revision user'), ), ); // fecha $data['seguimiento_proyecto']['fecha'] = array( 'title' => t('Created date'), // The item it appears as on the UI, 'help' => t('The date the seguimiento was last created.'), // The help that appears on the UI, 'field' => array( 'handler' => 'views_handler_field_date', 'click sortable' => TRUE, ), 'sort' => array( 'handler' => 'views_handler_sort_date', ), 'filter' => array( 'handler' => 'views_handler_filter_date', ), ); // acumulativo $data['seguimiento_proyecto']['acumulativo'] = array( 'title' => t('Unidad Acumulativa'), 'help' => t('Indica si la unidad de medida es acumulativa.'), 'field' => array( 'handler' => 'views_handler_field_boolean', 'click sortable' => TRUE, 'output formats' => array( '1-0' => array(t('Acumulativa'), t('No acumulativa')), ), ), 'filter' => array( 'handler' => 'views_handler_filter_boolean_operator', 'label' => t('Acumulativa'), 'type' => 'yes-no', 'use equal' => TRUE, // Use status = 1 instead of status <> 0 in WHERE statment ), 'sort' => array( 'handler' => 'views_handler_sort', ), ); // mes $data['seguimiento_proyecto']['mes'] = array( 'title' => t('El mes del Seguimiento'), // The item it appears as on the UI, 'help' => t('El mes del Seguimiento.'), // The help that appears on the UI, 'field' => array( 'handler' => 'proyecto_operativo_seguimiento_views_handler_field_mes', 'click sortable' => TRUE, ), 'sort' => array( 'handler' => 'views_handler_sort_date', ), 'filter' => array( 'handler' => 'proyecto_operativo_seguimiento_views_handler_filter_mes', ), ); if (module_exists('workflow')) { // estado $data['seguimiento_proyecto']['estado'] = array( 'title' => t('Workflow'), // The item it appears as on the UI, 'help' => t('Workflow.'), // The help that appears on the UI, 'field' => array( 'handler' => 'proyecto_operativo_seguimiento_views_handler_field_sid', 'click sortable' => TRUE, ), 'sort' => array( 'handler' => 'views_handler_sort_numeric', ), 'filter' => array( 'handler' => 'proyecto_operativo_seguimiento_views_handler_filter_sid', ), ); } // ejecutadometafisica $data['seguimiento_proyecto']['ejecutadometafisica'] = array( 'title' => t('Ejecutado meta fisica'), // The item it appears as on the UI, 'help' => t('Ejecutado meta fisica.'), // The help that appears on the UI, 'field' => array( 'handler' => 'views_handler_field_numeric', 'click sortable' => TRUE, ), 'sort' => array( 'handler' => 'views_handler_sort_numeric', ), 'filter' => array( 'handler' => 'views_handler_filter_numeric', ), ); //infocomplementaria_metafisica $data['seguimiento_proyecto']['infocomplementaria_metafisica'] = array( 'title' => t('Información Meta fisica'), // The item it appears as on the UI, 'help' => t('El texto ingresado de la meta fisica.'), // The help that appears on the UI, // Information for displaying a title as a field 'field' => array( 'handler' => 'views_handler_field_xss', ), 'sort' => array( 'handler' => 'views_handler_sort', ), // Information for accepting a title as a filter 'filter' => array( 'handler' => 'views_handler_filter_string', ), 'argument' => array( 'handler' => 'views_handler_argument_string', ), ); //infocomplementaria_metafinanciera $data['seguimiento_proyecto']['infocomplementaria_metafinanciera'] = array( 'title' => t('Información Meta Financiera'), // The item it appears as on the UI, 'help' => t('El texto ingresado de la meta financiera.'), // The help that appears on the UI, // Information for displaying a title as a field 'field' => array( 'handler' => 'views_handler_field_xss', ), 'sort' => array( 'handler' => 'views_handler_sort', ), // Information for accepting a title as a filter 'filter' => array( 'handler' => 'views_handler_filter_string', ), 'argument' => array( 'handler' => 'views_handler_argument_string', ), ); $data['seguimiento_proyecto_beneficiarios']['table']['group'] = t('Seguimiento proyectos operativos'); $data['seguimiento_proyecto_beneficiarios']['table']['join'] = array( 'seguimiento_proyecto' => array( 'left_field' => 'id_seg', 'field' => 'id_seg', 'type' => 'INNER', ), ); // cant_beneficiarios_mes $data['seguimiento_proyecto_beneficiarios']['cant_beneficiarios_mes'] = array( 'title' => t('Cantidad de beneficiarios'), // The item it appears as on the UI, 'help' => t('Cantidad de beneficiarios que hubo en el mes.'), // The help that appears on the UI, 'field' => array( 'handler' => 'views_handler_field_numeric', 'click sortable' => TRUE, ), 'sort' => array( 'handler' => 'views_handler_sort_numeric', ), 'filter' => array( 'handler' => 'views_handler_filter_numeric', ), ); // posicion_beneficiario $data['seguimiento_proyecto_beneficiarios']['posicion_beneficiario'] = array( 'title' => t('Tipo de beneficiario'), // The item it appears as on the UI, 'help' => t('Tipo de beneficiario que hubo en el mes.'), // The help that appears on the UI, 'field' => array( 'handler' => 'proyecto_operativo_seguimiento_views_handler_field_term', 'click sortable' => TRUE, ), 'sort' => array( 'handler' => 'views_handler_sort_numeric', ), 'filter' => array( 'handler' => 'views_handler_filter_numeric', ), ); //seguimiento AE if (module_exists('accion_especifica_de_proyecto_seguimiento')) { $data['seguimiento_aeproyecto']['table']['group'] = t('Seguimiento Acciones Especificas'); $data['seguimiento_aeproyecto']['table']['base'] = array( 'field' => 'id_seg', 'title' => t('Seguimiento de AE'), 'help' => t("Permite consultar el seguimiento de las AE."), ); // For other base tables, explain how we join $data['seguimiento_aeproyecto']['table']['join'] = array( // Directly links to node table. 'node' => array( 'left_field' => 'nid', 'field' => 'nid', ), 'users' => array( 'left_field' => 'uid', 'field' => 'uid', ), ); // id_seg $data['seguimiento_aeproyecto']['id_seg'] = array( 'title' => t('Id_seg'), 'help' => t('The ID of seguimiento.'), // The help that appears on the UI, // Information for displaying the nid 'field' => array( 'handler' => 'views_handler_field_numeric', 'click sortable' => TRUE, ), // Information for accepting a nid as an argument 'argument' => array( 'handler' => 'views_handler_argument_numeric', ), // Information for accepting a nid as a filter 'filter' => array( 'handler' => 'views_handler_filter_numeric', ), // Information for sorting on a nid. 'sort' => array( 'handler' => 'views_handler_sort', ), ); //nid $data['seguimiento_aeproyecto']['nid'] = array( 'title' => t('Nid de la AE.'), 'help' => t('Nid de la AE.'), 'relationship' => array( 'base' => 'node', 'base field' => 'nid', 'field' => 'nid', 'handler' => 'views_handler_relationship', 'label' => t('Nid Proyecto'), ), 'field' => array( 'handler' => 'views_handler_field_node', 'click sortable' => TRUE, ), 'sort' => array( 'handler' => 'views_handler_sort', ), ); // uid field for seguimiento $data['seguimiento_aeproyecto']['uid'] = array( 'title' => t('User'), 'help' => t('Relate a seguimiento to the user who created the seguimiento.'), 'relationship' => array( 'handler' => 'views_handler_relationship', 'base' => 'users', 'field' => 'uid', 'label' => t('revision user'), ), ); // fecha $data['seguimiento_aeproyecto']['fecha'] = array( 'title' => t('Created date'), // The item it appears as on the UI, 'help' => t('The date the seguimiento was last created.'), // The help that appears on the UI, 'field' => array( 'handler' => 'views_handler_field_date', 'click sortable' => TRUE, ), 'sort' => array( 'handler' => 'views_handler_sort_date', ), 'filter' => array( 'handler' => 'views_handler_filter_date', ), ); // acumulativo $data['seguimiento_aeproyecto']['acumulativo'] = array( 'title' => t('Unidad Acumulativa'), 'help' => t('Indica si la unidad de medida es acumulativa.'), 'field' => array( 'handler' => 'views_handler_field_boolean', 'click sortable' => TRUE, 'output formats' => array( '1-0' => array(t('Acumulativa'), t('No acumulativa')), ), ), 'filter' => array( 'handler' => 'views_handler_filter_boolean_operator', 'label' => t('Acumulativa'), 'type' => 'yes-no', 'use equal' => TRUE, // Use status = 1 instead of status <> 0 in WHERE statment ), 'sort' => array( 'handler' => 'views_handler_sort', ), ); if (module_exists('workflow')) { // estado $data['seguimiento_aeproyecto']['estado'] = array( 'title' => t('Workflow'), // The item it appears as on the UI, 'help' => t('Workflow'), // The help that appears on the UI, 'field' => array( 'handler' => 'proyecto_operativo_seguimiento_views_handler_field_sid', 'click sortable' => TRUE, ), 'sort' => array( 'handler' => 'views_handler_sort_numeric', ), 'filter' => array( 'handler' => 'proyecto_operativo_seguimiento_views_handler_filter_sid', ), ); } // mes $data['seguimiento_aeproyecto']['mes'] = array( 'title' => t('El mes del Seguimiento'), // The item it appears as on the UI, 'help' => t('El mes del Seguimiento.'), // The help that appears on the UI, 'field' => array( 'handler' => 'proyecto_operativo_seguimiento_views_handler_field_mes', 'click sortable' => TRUE, ), 'sort' => array( 'handler' => 'views_handler_sort_numeric', ), 'filter' => array( 'handler' => 'proyecto_operativo_seguimiento_views_handler_filter_mes', ), ); // ejecutadometafisica $data['seguimiento_aeproyecto']['ejecutadometafisica'] = array( 'title' => t('Ejecutado meta fisica'), // The item it appears as on the UI, 'help' => t('Ejecutado meta fisica.'), // The help that appears on the UI, 'field' => array( 'handler' => 'views_handler_field_numeric', 'click sortable' => TRUE, ), 'sort' => array( 'handler' => 'views_handler_sort_numeric', ), 'filter' => array( 'handler' => 'views_handler_filter_numeric', ), ); //infocomplementaria_metafisica $data['seguimiento_aeproyecto']['infocomplementaria_metafisica'] = array( 'title' => t('Información Meta fisica'), // The item it appears as on the UI, 'help' => t('El texto ingresado de la meta fisica.'), // The help that appears on the UI, // Information for displaying a title as a field 'field' => array( 'handler' => 'views_handler_field_xss', ), 'sort' => array( 'handler' => 'views_handler_sort', ), // Information for accepting a title as a filter 'filter' => array( 'handler' => 'views_handler_filter_string', ), 'argument' => array( 'handler' => 'views_handler_argument_string', ), ); //infocomplementaria_metafinanciera $data['seguimiento_aeproyecto']['infocomplementaria_metafinanciera'] = array( 'title' => t('Información Meta Financiera'), // The item it appears as on the UI, 'help' => t('El texto ingresado de la meta financiera.'), // The help that appears on the UI, // Information for displaying a title as a field 'field' => array( 'handler' => 'views_handler_field_xss', ), 'sort' => array( 'handler' => 'views_handler_sort', ), // Information for accepting a title as a filter 'filter' => array( 'handler' => 'views_handler_filter_string', ), 'argument' => array( 'handler' => 'views_handler_argument_string', ), ); $data['seguimiento_aeproyecto_partida']['table']['group'] = t('Seguimiento Acciones Especificas'); $data['seguimiento_aeproyecto_partida']['table']['join'] = array( 'seguimiento_aeproyecto' => array( 'left_field' => 'id_seg', 'field' => 'id_seg', 'type' => 'INNER', ), ); // id_seg_partida $data['seguimiento_aeproyecto_partida']['id_seg_partida'] = array( 'title' => t('Id_seg_partida'), 'help' => t('The ID del seguimiento de la partida.'), // The help that appears on the UI, // Information for displaying the nid 'field' => array( 'handler' => 'views_handler_field_numeric', 'click sortable' => TRUE, ), // Information for accepting a nid as an argument 'argument' => array( 'handler' => 'views_handler_argument_numeric', ), // Information for accepting a nid as a filter 'filter' => array( 'handler' => 'views_handler_filter_numeric', ), // Information for sorting on a nid. 'sort' => array( 'handler' => 'views_handler_sort', ), ); $arreglo = array( 'partida' => t('Partida'), 'comprometido' => t('Comprometido'), 'causado' => t('Causado'), 'pagado' => t('Pagado'), ); foreach($arreglo as $i => $a) { $handler = $i == 'partida'? 'proyecto_operativo_seguimiento_views_handler_field_partida' : 'views_handler_field_numeric'; $handler_filter = $i == 'partida'? 'proyecto_operativo_seguimiento_views_handler_field_term' : 'views_handler_field_numeric'; $data['seguimiento_aeproyecto_partida'][$i] = array( 'title' => $a, // The item it appears as on the UI, 'help' => t('El ' . $a . ' del mes de la partida.'), // The help that appears on the UI, 'field' => array( 'handler' => $handler, 'click sortable' => TRUE, ), 'sort' => array( 'handler' => 'views_handler_sort_numeric', ), 'filter' => array( 'handler' => 'views_handler_filter_numeric', ), ); } } return $data; } /* * Implementation of hook_views_handlers */ function proyecto_operativo_seguimiento_views_handlers() { return array( 'info' => array( 'path' => drupal_get_path('module', 'proyecto_operativo_seguimiento') .'/views', ), 'handlers' => array( 'proyecto_operativo_seguimiento_views_handler_field_mes' => array( 'parent' => 'views_handler_field', ), 'proyecto_operativo_seguimiento_views_handler_field_sid' => array( 'parent' => 'views_handler_field', ), 'proyecto_operativo_seguimiento_views_handler_field_term' => array( 'parent' => 'views_handler_field', ), 'proyecto_operativo_seguimiento_views_handler_field_partida' => array( 'parent' => 'views_handler_field', ), 'proyecto_operativo_seguimiento_views_handler_filter_mes' => array( 'parent' => 'views_handler_filter_in_operator', ), 'proyecto_operativo_seguimiento_views_handler_filter_sid' => array( 'parent' => 'views_handler_filter_in_operator', ), ), ); }