In office_hours.module, office_hours_field_views_data() (line 435) and _office_hours_views_field_views_data() (line 450) are both commented out, I'm guessing the views integration still needs to be finished.

I've never done any serious views integration before, but would like to help with this, since I need it for a project. Is it possible for one of the maintainers (or someone else knowledgeable about views integration willing to have a look at this) to give some pointers on how to start, what needs to happen, ...? I'm particularly interested in getting the exposed filters to work.

Comments

Ozeuss’s picture

Views integration here is a pickle, because there isn't a filter readily available for multiple values like in this module.
the new views api is also a bit complex to understand esp for someone not used to OOP.
I suggest you look at existing filters and views documentation. In essence you start from a specific filter and override it.

johnv’s picture

Category: task » feature
johnv’s picture

Title: Finish Views integration: filters, ... » Finish Views 3 integration: fields, filter criteria, sort criteria, ...

Made this commit. This is the current status:

Se the following resources for upgrading info. They have not been followed yet:
- Under Advanced Help for Views is a page "Upgrading to Drupal 7 (API)"
- http://www.davereid.net/content/preparing-your-modules-drupal-7
- http://larsolesen.dk/node/273 for an example filter time-handler.

Modifications to support Views 3:
- .module file : changed hook_views_api() from Views 2 to Views 3;
- .views.inc file: moved from includes file to root, and moved commented-out Views-related code from .module file.
- .info file: added declaration of handlers

Views Fields:
- Works as expected: you can add the field, and format it with the Field formatter.

Views Filter criteria:
- the contrib filters are commented out in .info file, so should not be effective.
- so it contains only the default Views out-of-the-box supported operations and subfields.
This means you can now select nodes with an exact time like: sunday, end-time = 1700 hours.
Ranges are not working.

Views Sort criteria:
- so it contains only the default Views out-of-the-box supported operations and subfields. not sure these are helpful.

johnv’s picture

Updated the README file with Views 3 documentation.
See here.

  • johnv committed 3bc2e8a on 8.x-1.x
    Issue #1364096: Added very basic Views 3 support.
    
Anybody’s picture

Issue summary: View changes

Currently it is not possible to expose a filter by day with checkboxes for example matching the non-closed days. Any plans for things like that?

johnv’s picture

Component: Code » Integrating Feeds
johnv’s picture

Component: Integrating Feeds » Integrating Views
johnv’s picture

Title: Finish Views 3 integration: fields, filter criteria, sort criteria, ... » Add Views 3 integration: fields, filter criteria, sort criteria, ... [D7]
johnv’s picture

Status: Active » Closed (outdated)

Closing all D7 requests, since I cannot maintain this anymore.