CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • How to pass a search result between users ?
Pages: [1]

Author Topic: How to pass a search result between users ?  (Read 1175 times)

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
How to pass a search result between users ?
March 09, 2009, 03:11:40 am
Hi,

each search criterias is transformed into a qfKey . It doesn't seem to be possible to pass this url with key between users, nor to keep it for a long time.

I've seen a "force=1" criteria, and I did plan to use it but not sure how to do it in regards to the criteria. Say I want to have the individuals in belgium that are tagged with the tag 8:

/civicrm/contact/search/basic?force=1&country=Belgium&Tags|8]=1&contact_type=Individual


It doesn't take into account the criterias and dump all the contacts, no matter their tag, country or type. Any suggestion ?

X+



-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: How to pass a search result between users ?
March 09, 2009, 08:17:02 am

use a smart group :)

i.e. user 1 does the search and creates a smart group. user 2 can then access the members of this smart group (via q=/civicrm/group/search?reset=1&force=1&context=smog&gid=2)

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: How to pass a search result between users ?
March 09, 2009, 08:57:36 am
Hi,

Well, I want to do that with all the contries, and various tags combination. Not so smart anymore ;)

I'll try with profiles, the force=1 works with param if I'm right.
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: How to pass a search result between users ?
March 09, 2009, 11:40:45 am

i think this comes down to: How do you get the GET params to be part of the search query. We've done it for a few fields in civicrm search (id, gid) and you can potentially mimic that and generalize it. Might be quite useful to add this functionality.

Another option might be to use a hook to enable this, am still thinking on how easily to do this and where it makes sense to do so :)

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: How to pass a search result between users ?
March 09, 2009, 02:04:03 pm
Hi,

What about letting all the params that are POST working as well when they are GET and force=1 ?

Is there a performance reason ? security concern ?

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: How to pass a search result between users ?
March 09, 2009, 02:24:27 pm

in the medium term that is the way to go, however a couple of caveats:

1. there is not support for that in the QuickForm package, hence will need to be manually coded in and/or support built at that level.

2. in POST we can use values posted while the labels are displayed, in GET you'd want to use labels rather than values (or probably either), and the layer would need to translate to what the code expects

3. checkboxes (which sends an array in POST) would need a similar translation

bottom line, there will be a fair amount of code and testing involved to do it. i.e. not a 2-hour hack :) (maybe 4 hours, if we find the right place to do it:P

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: How to pass a search result between users ?
March 09, 2009, 03:52:12 pm
Quote
2. in POST we can use values posted while the labels are displayed, in GET you'd want to use labels rather than values (or probably either), and the layer would need to translate to what the code expects

3. checkboxes (which sends an array in POST) would need a similar translation


Not sure that's a big deal. I mean, you have to look at the html code of the basic or advanced form to know what are the name of the GET params anyway, not a big deal to do it too for the values.

I did try to add in CRM/Contact/Form/Search.php

Code: [Select]
if ($_GET['force'] && empty($_POST)) {
   foreach ($_GET as $key => $value) {
     $_POST[$key] = $value;
   }
   $_POST['_qf_Basic_refresh'] = "Forced search";
   $_POST['__qf_default'] = "Basic:refresh";
}

;(

But it seems that Quickform is doing plenty of magic around it (btw, I find this package very messy and complicated to follow without big benefits over a simplier controler eg on zend or ezcomponent). Looks a bit more complicated than a few minutes hack indeed ;)

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • How to pass a search result between users ?

This forum was archived on 2017-11-26.