views support

mdowsett - March 21, 2008 - 03:26
Project:membership
Version:5.x-1.2
Component:User interface
Category:support request
Priority:normal
Assigned:Unassigned
Status:active
Description

How about the ability to show the membership expiry date on the user's profile page as well as being able to post it in a custom view?

#1

Boobaa - April 4, 2008 - 05:51

Good idea, and it is not too difficult to implement.

#2

mdowsett - April 4, 2008 - 13:22

cool! I thought Views integration may require a lot of work. I'm looking forward to seeing that.

#3

Boobaa - April 4, 2008 - 14:48

Well, do you want to have complete Views integration, or just a simple field added onto the user's profile page? ;)

#4

mdowsett - April 7, 2008 - 16:11

Views integration....so you can show a member's expiry date in a View Table

#5

Boobaa - May 6, 2008 - 09:08
Status:active» closed

The just released membership-5.x-1.1 has views support in it.

#6

mdowsett - June 23, 2008 - 20:20
Status:closed» active

I upgraded my test site OK, it shows the "Membership Expires" field in Views....but now I go to update the live site to the v1.1 of the membership module and it doesn't show that field in the Views creation.

But then again, it doesn't show some other module's fields (signup) so it may be a deeper problem...any ideas? I even tried to create a brand new View and those fields aren't listed to be chosen.

#7

mdowsett - June 23, 2008 - 20:23
Status:active» closed

Nevermind...I disabled and re-enabled the membership module and that fixed it....strange...

#8

mdowsett - March 13, 2009 - 13:55
Version:5.x-1.0» 5.x-1.2
Status:closed» active

I'm re-opening this...

I just noticed that the 'Membership Expires' field IS in the View's field listing.....but not in the Views' Filter listing

I'd like to create a View that only has member's with current memberships (ie the membership expires date hasn't passed)

#9

mdowsett - March 13, 2009 - 14:10
Status:active» needs work

I took a stab at adding it to the filters....I'm no coder (at all) so I don't know how to create a patch.

I tried putting this code in the existing views section of the membership.module file:

'filters' => array(
  'expires' => array(
'field' => 'expires',
'name' => t('Membership: Expires'),
'operator' => 'views_handler_operator_gtlt',
'value' => views_handler_filter_date_value_form(),
'option' => 'string',
'handler' => $handler,
'help' => t('This filter allows bios to be filtered by their Membership expiry date. Enter dates in the format: CCYY-MM-DD HH:MM:SS. Enter \'now\' to use the current time. You may enter a delta (in seconds) to the option that will be added to the time; this is most useful when combined with now. If you have the jscalendar module from jstools installed, you can use a popup date picker here.'),
  ),
),

I didn't get errors so I was proud! :) But it doesn't list the "Membership: Expires" item in the list of available filters.

Can someone review to see if I was close?!

Many thanks.

#10

mdowsett - March 15, 2009 - 01:52
Status:needs work» won't fix

I found a work-around....linking membership processing to a role and then using that role as a filter in the view.

Works nicely and opens the door to other features (auto denied access to site/features as membership expires)

#11

mdowsett - June 29, 2009 - 15:52
Status:won't fix» active

now for the opposite...how would I create a Views list of people with an expired membership?

I believe once a user's membership has expired, it reads 'never' as the date and removes them from the Membership role.

#1 I tried using the 'Membership Expires' field is less than 'now'. That showed noone.
#2 I tried using the 'Membership Expires' field equals 'never'. That showed noone.
#3 I tried using the 'Role: Author Role' is 'none of' and selected the Membership role but that showed all users.

I didn't expect the 'Role: Author Role' one to work since it's wording talks about INCLUDING node owners that fit the selected role(s) whereas I want to EXCLUDE users...I don't think I'm using that field right.

It seems to me the best solution would be go get #1 or #2 from above working

 
 

Drupal is a registered trademark of Dries Buytaert.