Conjunto 8723a53 en sipes


Ignorar:
Fecha y hora:
04/05/2017 16:16:13 (hace 7 años)
Autor:
Sipes Apn <root@…>
Branches:
version-3.0
Children:
ecc4f3e
Parents:
bcc4c51
Mensaje:

se agregaron los contralores para la integración con el modulo views

Fichero:
1 editado

Leyenda

No modificado
Añadido
Eliminado
  • 0.3-modules/proyectos_operativos_seguimiento/views/proyecto_operativo_seguimiento.views.inc

    rbcc4c51 r8723a53  
    3737function proyecto_operativo_seguimiento_views_data() {
    3838  $data['seguimiento_proyecto']['table']['group'] = t('Seguimiento proyectos operativos');
    39 
    4039  $data['seguimiento_proyecto']['table']['base'] = array(
    4140    'field' => 'id_seg',
     
    5655    ),
    5756  );
    58 
    5957  // id_seg
    6058  $data['seguimiento_proyecto']['id_seg'] = array(
     
    7977    ),
    8078  );
    81 
    8279  //nid
    8380  $data['seguimiento_proyecto']['nid'] = array(
     
    9895    ),
    9996  );
    100 
    10197  // uid field for seguimiento
    10298  $data['seguimiento_proyecto']['uid'] = array(
     
    133129      'click sortable' => TRUE,
    134130      'output formats' => array(
    135         'published-notpublished' => array(t('Acumulativa'), t('No acumulativa')),
     131        '1-0' => array(t('Acumulativa'), t('No acumulativa')),
    136132      ),
    137133    ),
     
    151147    'help' => t('El mes del Seguimiento.'), // The help that appears on the UI,
    152148    'field' => array(
    153       'handler' => 'views_handler_field_numeric',
     149      'handler' => 'proyecto_operativo_seguimiento_views_handler_field_mes',
    154150      'click sortable' => TRUE,
    155151    ),
     
    158154    ),
    159155    'filter' => array(
    160       'handler' => 'views_handler_filter_numeric',
    161     ),
    162   );
     156      'handler' => 'proyecto_operativo_seguimiento_views_handler_filter_mes',
     157    ),
     158  );
     159  if (module_exists('workflow')) {
     160    // estado
     161    $data['seguimiento_proyecto']['estado'] = array(
     162      'title' => t('Workflow'), // The item it appears as on the UI,
     163      'help' => t('Workflow.'), // The help that appears on the UI,
     164      'field' => array(
     165        'handler' => 'proyecto_operativo_seguimiento_views_handler_field_sid',
     166        'click sortable' => TRUE,
     167      ),
     168      'sort' => array(
     169        'handler' => 'views_handler_sort_numeric',
     170      ),
     171      'filter' => array(
     172        'handler' => 'proyecto_operativo_seguimiento_views_handler_filter_sid',
     173      ),
     174    );
     175  }
    163176  // ejecutadometafisica
    164177  $data['seguimiento_proyecto']['ejecutadometafisica'] = array(
     
    170183    ),
    171184    'sort' => array(
    172       'handler' => 'views_handler_sort_date',
     185      'handler' => 'views_handler_sort_numeric',
    173186    ),
    174187    'filter' => array(
     
    214227    ),
    215228  );
    216 
     229    $data['seguimiento_proyecto_beneficiarios']['table']['group'] = t('Seguimiento proyectos operativos');
     230    $data['seguimiento_proyecto_beneficiarios']['table']['join'] = array(
     231      'seguimiento_proyecto' => array(
     232        'left_field' => 'id_seg',
     233        'field' => 'id_seg',
     234        'type' => 'INNER',
     235      ),
     236    );
     237
     238
     239  // cant_beneficiarios_mes
     240  $data['seguimiento_proyecto_beneficiarios']['cant_beneficiarios_mes'] = array(
     241    'title' => t('Cantidad de beneficiarios'), // The item it appears as on the UI,
     242    'help' => t('Cantidad de beneficiarios que hubo en el mes.'), // The help that appears on the UI,
     243    'field' => array(
     244      'handler' => 'views_handler_field_numeric',
     245      'click sortable' => TRUE,
     246    ),
     247    'sort' => array(
     248      'handler' => 'views_handler_sort_numeric',
     249    ),
     250    'filter' => array(
     251      'handler' => 'views_handler_filter_numeric',
     252    ),
     253  );
     254  // posicion_beneficiario
     255  $data['seguimiento_proyecto_beneficiarios']['posicion_beneficiario'] = array(
     256    'title' => t('Tipo de beneficiario'), // The item it appears as on the UI,
     257    'help' => t('Tipo de beneficiario que hubo en el mes.'), // The help that appears on the UI,
     258    'field' => array(
     259      'handler' => 'proyecto_operativo_seguimiento_views_handler_field_term',
     260      'click sortable' => TRUE,
     261    ),
     262    'sort' => array(
     263      'handler' => 'views_handler_sort_numeric',
     264    ),
     265    'filter' => array(
     266      'handler' => 'views_handler_filter_numeric',
     267    ),
     268  );
     269
     270
     271
     272
     273
     274  //seguimiento AE
     275  if (module_exists('accion_especifica_de_proyecto_seguimiento')) {
     276    $data['seguimiento_aeproyecto']['table']['group'] = t('Seguimiento Acciones Especificas');
     277    $data['seguimiento_aeproyecto']['table']['base'] = array(
     278      'field' => 'id_seg',
     279      'title' => t('Seguimiento de AE'),
     280      'help' => t("Permite consultar el seguimiento de las AE."),
     281    );
     282    // For other base tables, explain how we join
     283    $data['seguimiento_aeproyecto']['table']['join'] = array(
     284      // Directly links to node table.
     285      'node' => array(
     286        'left_field' => 'nid',
     287        'field' => 'nid',
     288      ),
     289      'users' => array(
     290        'left_field' => 'uid',
     291        'field' => 'uid',
     292      ),
     293    );
     294    // id_seg
     295    $data['seguimiento_aeproyecto']['id_seg'] = array(
     296      'title' => t('Id_seg'),
     297      'help' => t('The ID of seguimiento.'), // The help that appears on the UI,
     298      // Information for displaying the nid
     299      'field' => array(
     300        'handler' => 'views_handler_field_node',
     301        'click sortable' => TRUE,
     302      ),
     303      // Information for accepting a nid as an argument
     304      'argument' => array(
     305        'handler' => 'views_handler_argument_numeric',
     306      ),
     307      // Information for accepting a nid as a filter
     308      'filter' => array(
     309        'handler' => 'views_handler_filter_numeric',
     310      ),
     311      // Information for sorting on a nid.
     312      'sort' => array(
     313        'handler' => 'views_handler_sort',
     314      ),
     315    );
     316    //nid
     317    $data['seguimiento_aeproyecto']['nid'] = array(
     318      'title' => t('Nid de la AE.'),
     319      'help' => t('Nid de la AE.'),
     320      'relationship' => array(
     321        'base' => 'node',
     322        'base field' => 'nid',
     323        'field' => 'nid',
     324        'handler' => 'views_handler_relationship',
     325        'label' => t('Nid Proyecto'),
     326      ),
     327      'field' => array(
     328        'handler' => 'views_handler_field',
     329      ),
     330      'sort' => array(
     331        'handler' => 'views_handler_sort',
     332      ),
     333    );
     334    // uid field for seguimiento
     335    $data['seguimiento_aeproyecto']['uid'] = array(
     336      'title' => t('User'),
     337      'help' => t('Relate a seguimiento to the user who created the seguimiento.'),
     338      'relationship' => array(
     339        'handler' => 'views_handler_relationship',
     340        'base' => 'users',
     341        'field' => 'uid',
     342        'label' => t('revision user'),
     343      ),
     344    );
     345    // fecha
     346    $data['seguimiento_aeproyecto']['fecha'] = array(
     347      'title' => t('Created date'), // The item it appears as on the UI,
     348      'help' => t('The date the seguimiento was last created.'), // The help that appears on the UI,
     349      'field' => array(
     350        'handler' => 'views_handler_field_date',
     351        'click sortable' => TRUE,
     352      ),
     353      'sort' => array(
     354        'handler' => 'views_handler_sort_date',
     355      ),
     356      'filter' => array(
     357        'handler' => 'views_handler_filter_date',
     358      ),
     359    );
     360    // acumulativo
     361    $data['seguimiento_aeproyecto']['acumulativo'] = array(
     362      'title' => t('Unidad Acumulativa'),
     363      'help' => t('Indica si la unidad de medida es acumulativa.'),
     364      'field' => array(
     365        'handler' => 'views_handler_field_boolean',
     366        'click sortable' => TRUE,
     367        'output formats' => array(
     368          '1-0' => array(t('Acumulativa'), t('No acumulativa')),
     369        ),
     370      ),
     371      'filter' => array(
     372        'handler' => 'views_handler_filter_boolean_operator',
     373        'label' => t('Acumulativa'),
     374        'type' => 'yes-no',
     375        'use equal' => TRUE, // Use status = 1 instead of status <> 0 in WHERE statment
     376      ),
     377      'sort' => array(
     378        'handler' => 'views_handler_sort',
     379      ),
     380    );
     381    if (module_exists('workflow')) {
     382      // estado
     383      $data['seguimiento_aeproyecto']['estado'] = array(
     384        'title' => t('Workflow'), // The item it appears as on the UI,
     385        'help' => t('Workflow'), // The help that appears on the UI,
     386        'field' => array(
     387          'handler' => 'proyecto_operativo_seguimiento_views_handler_field_sid',
     388          'click sortable' => TRUE,
     389        ),
     390        'sort' => array(
     391          'handler' => 'views_handler_sort_numeric',
     392        ),
     393        'filter' => array(
     394          'handler' => 'proyecto_operativo_seguimiento_views_handler_filter_sid',
     395        ),
     396      );
     397    }
     398    // mes
     399    $data['seguimiento_aeproyecto']['mes'] = array(
     400      'title' => t('El mes del Seguimiento'), // The item it appears as on the UI,
     401      'help' => t('El mes del Seguimiento.'), // The help that appears on the UI,
     402      'field' => array(
     403        'handler' => 'proyecto_operativo_seguimiento_views_handler_field_mes',
     404        'click sortable' => TRUE,
     405      ),
     406      'sort' => array(
     407        'handler' => 'views_handler_sort_numeric',
     408      ),
     409      'filter' => array(
     410        'handler' => 'proyecto_operativo_seguimiento_views_handler_filter_mes',
     411      ),
     412    );
     413    // ejecutadometafisica
     414    $data['seguimiento_aeproyecto']['ejecutadometafisica'] = array(
     415      'title' => t('Ejecutado meta fisica'), // The item it appears as on the UI,
     416      'help' => t('Ejecutado meta fisica.'), // The help that appears on the UI,
     417      'field' => array(
     418        'handler' => 'views_handler_field_numeric',
     419        'click sortable' => TRUE,
     420      ),
     421      'sort' => array(
     422        'handler' => 'views_handler_sort_numeric',
     423      ),
     424      'filter' => array(
     425        'handler' => 'views_handler_filter_numeric',
     426      ),
     427    );
     428    //infocomplementaria_metafisica
     429    $data['seguimiento_aeproyecto']['infocomplementaria_metafisica'] = array(
     430      'title' => t('Información Meta fisica'), // The item it appears as on the UI,
     431      'help' => t('El texto ingresado de la meta fisica.'), // The help that appears on the UI,
     432       // Information for displaying a title as a field
     433      'field' => array(
     434        'handler' => 'views_handler_field_xss',
     435       ),
     436      'sort' => array(
     437        'handler' => 'views_handler_sort',
     438      ),
     439      // Information for accepting a title as a filter
     440      'filter' => array(
     441        'handler' => 'views_handler_filter_string',
     442      ),
     443      'argument' => array(
     444        'handler' => 'views_handler_argument_string',
     445      ),
     446    );
     447    //infocomplementaria_metafinanciera
     448    $data['seguimiento_aeproyecto']['infocomplementaria_metafinanciera'] = array(
     449      'title' => t('Información Meta Financiera'), // The item it appears as on the UI,
     450      'help' => t('El texto ingresado de la meta financiera.'), // The help that appears on the UI,
     451       // Information for displaying a title as a field
     452      'field' => array(
     453        'handler' => 'views_handler_field_xss',
     454       ),
     455      'sort' => array(
     456        'handler' => 'views_handler_sort',
     457      ),
     458      // Information for accepting a title as a filter
     459      'filter' => array(
     460        'handler' => 'views_handler_filter_string',
     461      ),
     462      'argument' => array(
     463        'handler' => 'views_handler_argument_string',
     464      ),
     465    );
     466    $data['seguimiento_aeproyecto_partida']['table']['group'] = t('Seguimiento Acciones Especificas');
     467    $data['seguimiento_aeproyecto_partida']['table']['join'] = array(
     468      'seguimiento_aeproyecto' => array(
     469        'left_field' => 'id_seg',
     470        'field' => 'id_seg',
     471        'type' => 'INNER',
     472      ),
     473    );
     474    // id_seg_partida
     475    $data['seguimiento_aeproyecto_partida']['id_seg_partida'] = array(
     476      'title' => t('Id_seg_partida'),
     477      'help' => t('The ID del seguimiento de la partida.'), // The help that appears on the UI,
     478      // Information for displaying the nid
     479      'field' => array(
     480        'handler' => 'views_handler_field_numeric',
     481        'click sortable' => TRUE,
     482      ),
     483      // Information for accepting a nid as an argument
     484      'argument' => array(
     485        'handler' => 'views_handler_argument_numeric',
     486      ),
     487      // Information for accepting a nid as a filter
     488      'filter' => array(
     489        'handler' => 'views_handler_filter_numeric',
     490      ), 
     491      // Information for sorting on a nid.
     492      'sort' => array(
     493        'handler' => 'views_handler_sort',
     494      ),
     495    );
     496    $arreglo = array(
     497      'partida' => t('Partida'),
     498      'comprometido' => t('Comprometido'),
     499      'causado' => t('Causado'),
     500      'pagado' => t('Pagado'),
     501    );
     502    foreach($arreglo as $i => $a) {
     503      $handler = $i == 'partida'? 'proyecto_operativo_seguimiento_views_handler_field_partida' : 'views_handler_field_numeric';
     504      $handler_filter = $i == 'partida'? 'proyecto_operativo_seguimiento_views_handler_field_term' : 'views_handler_field_numeric';
     505      $data['seguimiento_aeproyecto_partida'][$i] = array(
     506        'title' => $a, // The item it appears as on the UI,
     507        'help' => t('El ' . $a . ' del mes de la partida.'), // The help that appears on the UI,
     508        'field' => array(
     509          'handler' => $handler,
     510          'click sortable' => TRUE,
     511        ),
     512        'sort' => array(
     513          'handler' => 'views_handler_sort_numeric',
     514        ),
     515        'filter' => array(
     516          'handler' => 'views_handler_filter_numeric',
     517        ),
     518      );
     519    }
     520  }
    217521  return $data;
    218522}
     523
     524/*
     525 * Implementation of hook_views_handlers
     526 */
     527function proyecto_operativo_seguimiento_views_handlers() {
     528
     529  return array(
     530    'info' => array(
     531      'path' => drupal_get_path('module', 'proyecto_operativo_seguimiento') .'/views',
     532    ),
     533    'handlers' => array(
     534      'proyecto_operativo_seguimiento_views_handler_field_mes' => array(
     535        'parent' => 'views_handler_field',
     536      ),
     537      'proyecto_operativo_seguimiento_views_handler_field_sid' => array(
     538        'parent' => 'views_handler_field',
     539      ),
     540      'proyecto_operativo_seguimiento_views_handler_field_term' => array(
     541        'parent' => 'views_handler_field',
     542      ),
     543      'proyecto_operativo_seguimiento_views_handler_field_partida' => array(
     544        'parent' => 'views_handler_field',
     545      ),
     546      'proyecto_operativo_seguimiento_views_handler_filter_mes' => array(
     547        'parent' => 'views_handler_filter_in_operator',
     548      ),
     549      'proyecto_operativo_seguimiento_views_handler_filter_sid' => array(
     550        'parent' => 'views_handler_filter_in_operator',
     551      ),
     552    ),
     553  );
     554}
Nota: Vea TracChangeset para ayuda en el uso del visor de conjuntos de cambios.