And I think it should only show finalized bookings as it's a public page.

Comments

rodrigobb’s picture

Could it be because there are two views defined with the same name?

function publicbookings_view_schedules() {
[...]
  $view->name = 'publicbookings_view_schedules';
[...]
}

function publicbookings_view_schedules_admin() {
[...]
  $view->name = 'publicbookings_view_schedules';
[...]
}
Anonymous’s picture

Yes, thats possible. You could try this by simply altering the name of the admin-view. But its been a while since I last tested 1.x-views integration :/

Anonymous’s picture

Version: 6.x-1.0-alpha5 » 6.x-1.x-dev
Assigned: Unassigned »
Status: Active » Fixed

This should be fixed now ... if the problem reappears with the latest dev: Please reopen :)

rodrigobb’s picture

It works, partially.

The view works as espected now. Or as it's defined.
I will add a filter showing only 'Finalized' bookings and remove the 'Type' field.

And you have removed the button/link in the overview page (it's still accesible through the page-path).

I think it can work really fine if you make minor fixes:
- reenable the button/link
- add a filter for state = finalized
- remove the type field
- (optional) add a date filter to show only future bookings.

But thanks for your work

Anonymous’s picture

Which "type" field? The link in the overview page shouldn't have been removed, I'll look into this.

rodrigobb’s picture

Status: Fixed » Active

If you change the view name to 'publicbookings_view_schedules_admin' as you have done in -dev version, the link disappears (if tested it changing the name myself in -alpha5 version).

And also I've discovered other menu option dissapeared (in both versions, alpha5 and dev) 'publicbookings/resources'

rodrigobb’s picture

I've been making tests this weekend related with my #6 comment, but nothing.
I have no idea of why is this happening. Could you contact some Drupal guru for help?

rodrigobb’s picture

For this bug, I've fixed it.
Over -alpha5.

In publicbookings.view_default.inc (129: publicbookings_view_schedules method)

  $handler->override_option('filters', array(
    'disabled' => array([...]),
    'resource_id' => array([...]),
    'status' => array(
      'operator' => 'in',
      'value' => array('2' => '2',),
      'group' => '0',
      'exposed' => FALSE,
      'expose' => array(
        'operator' => FALSE,
        'label' => '',
        ),
      'id' => 'status',
      'table' => 'bookings_schedules',
      'field' => 'status',
      'override' => array(
        'button' => 'Override',
        ),
      'relationship' => 'none',
    ),
  ));

The new part is the las entry in the filters array ('status').

Anonymous’s picture

Status: Active » Fixed

Thanks!

It's commited.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

easyRider’s picture

Version: 6.x-1.x-dev » 6.x-3.0-alpha2
Component: Code » Public Bookings
Status: Closed (fixed) » Active

I got this bug with last version 6.x-3.0-alpha2.