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) »
  • Current employer: ajax don't work when too many organisations
Pages: [1]

Author Topic: Current employer: ajax don't work when too many organisations  (Read 1505 times)

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Current employer: ajax don't work when too many organisations
December 01, 2008, 11:49:05 pm
Hi,

Got a "european commission" organisation, and a bunch of "delegation of the european commission in X" (X being a country, and they are quite a few of them).

When trying to set the current employer, the autocomplete list is too long to display European commission, the one I want (the delegations being before the European commission).

So I can't update the current employer. Any idea how to force a strict search ? I've tried with quotes around, didn't work.

In general the "More" on the autocomplete is unuseful. Is it possible to replace it by "strict search/limit results" or something like that ?

I can't either update it from the relationship, because it doesn't update the current employer field.

Any idea ?

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

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Current employer: ajax don't work when too many organisations
December 02, 2008, 12:00:07 am
Related to that http://forum.civicrm.org/index.php/topic,5789.0.html

I'd be great to be able to search on the website name (eg "@civicrm.org" would retrieve civicrm llc)

Easy to hack ?

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

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Current employer: ajax don't work when too many organisations
December 02, 2008, 03:19:07 am
Quote
Is it possible to replace it by "strict search/limit results" or something like that ?

If you are on CiviCRM v2.1, you can modify CRM/Core/Page/AJAX.php search() , line around 219..

Hth

Kurund
Found this reply helpful? Support CiviCRM

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Current employer: ajax don't work when too many organisations
October 29, 2009, 09:55:13 am
And for those trying to do the same on 3.0.x :


Code: [Select]
Index: CRM/Contact/Page/AJAX.php
===================================================================
--- CRM/Contact/Page/AJAX.php   (revision 24659)
+++ CRM/Contact/Page/AJAX.php   (working copy)
@@ -261,7 +261,6 @@
             }

             if ( $organization ) {
-
                 $query = "
 SELECT CONCAT_WS(' :: ',sort_name,LEFT(street_address,25),city) 'sort_name',
 civicrm_contact.id 'id'
@@ -269,7 +268,7 @@
 LEFT JOIN civicrm_address ON ( civicrm_contact.id = civicrm_address.contact_id
                                 AND civicrm_address.is_primary=1
                              )
-WHERE civicrm_contact.contact_type='Organization' AND organization_name LIKE '%$contactName%'
+WHERE civicrm_contact.contact_type='Organization' AND organization_name LIKE '$contactName%'
 {$addStreet} {$addCity} {$whereIdClause}
 ORDER BY organization_name ";
             } else if ( $shared ) {
-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) »
  • Current employer: ajax don't work when too many organisations

This forum was archived on 2017-11-26.