Is anyone working on views integration for LM Paypal? If not I will start it and post the file(s) here, for testing and possible inclusion in the module. I know it has been mentioned on a few other threads, so thought it worth asking before l duplicate someone elses good work.

Jonathan

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jonathan1055’s picture

Status: Active » Needs review
FileSize
1.92 KB
9.02 KB

Here is the first draft of a views file, just for the base module table LM_PAYPAL_IPNS. The new file has an extra extension of .txt (to allow it to be uploaded here) but that should be removed when it is saved in the lm_paypal directory.

The patch file includes one change to lm_paypal.module to implement hook_views_api() and some minor text and spelling fixes to the the .install file. I noticed these because I am reusing the $schema defined in the .install file, as I did not fancy re-typing 70 field names and descriptions when I could re-use the given code.

I am currently only using the ipns table, I've not installed the sub-modules. If this patch and views file works, then we can discuss the next steps.

Jonathan

John Franklin’s picture

Status: Needs review » Fixed

Committed. Thanks for the patch.

John Franklin’s picture

Version: 6.x-2.x-dev » 7.x-1.x-dev
Status: Fixed » Patch (to be ported)

When porting this, pull from the 6.x-2.x branch instead of using this patch. There have been some enhancements made to the 6.x-2.x views integration since this was initially committed.

Alex Andrascu’s picture

Subscribing. #3 isn't very clear.

jonathan1055’s picture

Hi John,

Glad the patch was of use. Just to let you know, in relation to #3 that I am no longer using this module. Shame because I liked it. Nothing to do with the module, it was the client who unfortunately had to scrap their business model for on-line selling. So I wont be doing the port to D7, just in case you thought I was.

Jonathan

John Franklin’s picture

@johnathan10555 Sorry to hear their business didn't work out as planned. No, the note in #3 wasn't for you, specifically. It is a note for whoever gets to it first.

@Alex Andrascu -- the patch in #1 was the starting point for views integration. There have been a number of commits to the lm_paypal.views.inc file since then, so the patch in #1 does not reflect the current state of views integration. I hope that clarifies things.

ZetaTrooper’s picture

Priority: Normal » Major

Has anyone made any progress on this? The lm_paypal module would work great for Drupal 7 if there were a Views Integration that let you filter lm_payal items. This seems like a crucial feature to me that is lacking in the module.

As a clunky and potentially expensive workaround, a custom PHP filter can be used, however this is only useful if all you want to see is paid items from lm_paypal (which is sad because I want to show more than just paid items but it filters those out):

$nids = array();
$result = db_query("select s.nid
from lm_paypal_subscribers s
where s.status in (1,2,3)
group by s.nid");

foreach($result as $row) {
$nids[] = $row->nid;
}
if(in_array($data->nid, $nids))
{
return false;
}
else
{
return true;
}

drupalina’s picture

The code in #7 by ZetaTrooper helped me. But I want the Authors of the unpaid node (as well as the site administrators) to be able see that unpublished teaser in the view. How can that be achieved?