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 Profiles (Moderator: Dave Greenberg) »
  • Cannot use tabs because multi-valued custom data group in profile
Pages: [1]

Author Topic: Cannot use tabs because multi-valued custom data group in profile  (Read 2433 times)

borniol

  • Guest
Cannot use tabs because multi-valued custom data group in profile
September 22, 2009, 11:42:07 am
Hello,

I m quite new to civicrm and i m testing CiviCRM 2.2.9 with drupal for my organisation a national yoga association,
and i want to make a free access web directory of [trainer]/[training center or places]
1 trainer is associated to one or more (no limit) training places. A trainer can give courses in different town/area...

That 's why i created a custom data groups 'list of places' associated with a individual or contact type
in which i define several custom field as town, address, zip code etc..  I choose "multi-valued data" option, because
I do not know how many courses a trainer has... and it s display correctly in a new contact TABS

The functionnality i want is quite simple, as i need to create or use an advanced search form that will request
all yoga courses depending on all the criteria/custom field of the 'list of place' custom data group. As results, it should display
the trainer (individual) that give the course OR all the places with the combination of the trainer to contact.

The problem comes further when i want to use that custom fields in a profile to make my search citeria. In the new profile i created, i can't use or search
those custom data fields that are multi-valued. All other custom data single-valued are accessible in my profile, as a searchable field.
Finally, i  m blocked at this point. Perhaps, i need to review the organisation/structure of my data. Is it better to make a yoga course be associated to an activity type prefered than belonging to the individual/contact data ?

If Anybody can help... Thanks in advance
Borniol


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: Cannot use tabs because multi-valued custom data group in profile
September 22, 2009, 02:43:42 pm

Your best bet will be to write a custom search or custom report to display these training courses / combinations.

Activities are not exposed to profiles either so that might not be a great option either

I think for your specific use case, you will need to write some custom code

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

borniol

  • Guest
Re: Cannot use tabs because multi-valued custom data group in profile
September 23, 2009, 01:36:15 am
Thanks for your answer. I will follow your advice because i see that the advanced search page
do mostly the job that i want (http://vify-idf.org/civicrm/contact/search/advanced?reset=1). It displays an hidden tab
that show my custom data group fields with the possibility to search on those fields.

What could be cool, would be to dump only the custom fields data tabs section in the advanced form, but it seems to be a loop  ?
The problem is that i m not a developper, so i ll try to understand the custom search language use in civicrm. But if someone could help me giving links or code of custom search based on custom fields data, i will apreciate.
What is the template used in for this Form ? I m not sure, is it  civicrm/templates/CRM/Custom/Form/search.tpl ?

Thanks in advance for your support.
Borniol

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: Cannot use tabs because multi-valued custom data group in profile
September 23, 2009, 08:00:05 am

Yes, that is the template of the search form. It includes other templates and u can follow it from there

If you are not a developer, please be careful when modifying the code, make backups etc so u can revert (u should do this even if you are a develper)

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

borniol

  • Guest
Re: Cannot use tabs because multi-valued custom data group in profile
September 23, 2009, 10:30:57 am
Thanks for your supoort. I finally succeed to make the advanced search fill my needs, modifying directly the Advanced.php code. I removed
the  paneNames i didn't need and remove the basic form search, and the corresponding Basic template.

I know it s not really a nice job, but i couldn't make my own custom search as indicated in http://wiki.civicrm.org/confluence/display/CRMDOC/Custom+Search+Components  . I follow the guide, copying the Advanced.php file modified that suit my needs, to the Custom/Lieu.php Dir. I then, change the Class "class CRM_Contact_Form_Search_Advanced extends CRM_Contact_Form_Search" to "class CRM_Contact_Form_Search_Custom_Lieu extends CRM_Contact_Form_Search"  and registering it via the admin panel. But when i m lauching it http://my-site/civicrm/contact/search/custom?reset=1&csid=16,  i get the fatal error

Fatal error: Call to undefined method CRM_Contact_Form_Search_Custom_Lieu::columns() in CRM/Contact/Selector/Custom.php on line 216

So using the Advanced.php modified search, it's working nice, even if i would prefer having my own custom search so that upgrade do not overwrite CiviCRM Core files.

I have another question :  as the multi-value custom data groups aren't accessible via profiles to make a search form, it seems i can't use profiles to display the field/data the way i want. How then can i arrange the result page of the search or the contact page to have only certain field displayed, if i cannot use profile ?


Thanks in advance for your support.
« Last Edit: September 24, 2009, 01:46:01 am by borniol »

TimBoisvert

  • Guest
Re: Cannot use tabs because multi-valued custom data group in profile
November 26, 2009, 08:00:26 am
Quote from: Donald Lobo on September 22, 2009, 02:43:42 pm

Your best bet will be to write a custom search or custom report to display these training courses / combinations.

Activities are not exposed to profiles either so that might not be a great option either

I think for your specific use case, you will need to write some custom code

lobo

Lobo:

First, I want to thank you for all of your fantastic support of CiviCRM. I've found a wealth of information here as I've been implementing a new CiviCRM instance these past couple of weeks, and I really appreciate your efforts to answer questions.

I'm actually looking to do something similar to borniol -- I'm using custom profiles and I would benefit from being able to expose the tabs as part of my custom profile UI. I understand from reading your response here that the tab structure isn't exposed as part of the Profile. Why is that? How would you recommend I expose to the Profile object functionality similar to the Contact's Activities and Notes tabs.

Tim

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: Cannot use tabs because multi-valued custom data group in profile
November 26, 2009, 06:23:12 pm

i'm not sure i understand. Do u want to explain a bit more of your use case and what u r trying to do

Profiles when designed initially were meant to be fairly simple view of your contact data. They've become more complex along the way :(

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

TimBoisvert

  • Guest
Re: Cannot use tabs because multi-valued custom data group in profile
November 26, 2009, 09:55:16 pm
Here's a bit of context: We're attempting to use CiviCRM to manage a volunteer force that spends time out meeting people on a daily basis. They should be able to enter their contacts and then input activities and notes against those contacts as time progresses. The way the operation is based, though, there are a few very specific "records" that are used. Traditionally they've been paper-based and standardized across the entire globe. What we wanted to do was bring those few specific record types to the system and then based our UI around them, having the web-based versions look exactly like their paper-based counterparts.

Our solution was to create a profile for each record type and build a custom UI around each of the profiles. Since the form names are pretty particular and don't necessarily translate well, I'm going to use names here that parallel the business/sales world. When a rep first meets someone, they should go into the "Lead" form, which looks just like their paper-based Lead form, fill it out, and hit save. The "Lead" form is based on a profile we created called "Lead." We have a custom field called "Record Type" that indicates which record type is used, and when they fill out the "Lead" form, the "Record Type" value is forced (via hidden field) to "Lead." That all works fine. If they want to later come find that contact, they go to our "Search Leads" window, which is a customized Profile Listing based around the "Lead" profile. We want them to then be able to enter activities and notes for that "Lead," but since we've based our UIs around Profiles instead of Contacts, we have no access to the Activities and Notes.

As the activity progresses, they can convert the "Lead" into an "Opportunity." We do this by simply switching the Record Type to be "Opportunity" instead. Then when they want to search opportunities, they use a "Search Opportunities" window. The Activities and Notes should show up for the "Opportunity" like it did for the "Lead."

I hope that's enough context. Here are the questions I have:

- Is there a way to expose Activities and Notes to the Profile object so that we can access them via our custom "Lead" Profile object?
- More importantly: Did we design this wrong? We based our design on the assumption that we could create custom UIs for "Contact" objects. I suppose we could just alter the Contact template to include a different UI template based on the "Record Type" custom field, but we didn't want to get into a scenario where were adding "else if" statements every time we add a record type in the future. If there's no way to expose Activities and Notes to the Profile, this may be our only option.

Thank you again for your help.

Tim

TimBoisvert

  • Guest
Re: Cannot use tabs because multi-valued custom data group in profile
November 27, 2009, 12:36:33 am
OK, scratch my whole request -- I found a way to make it work. I was able to hard-code the tabs and call into the snippet pages for Activities and Notes... and now it's working just like I want it to!

I'm sorry to waste your time -- I'd like to make a donation to show my appreciation for all of your efforts in the forum. I work for a major open source software company (my day job -- this stuff I'm doing with CiviCRM is on the side) and I know how much commitment it takes to support a community of users. Is there a special project or department I should specify when I use the Donate link above?

Tim

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: Cannot use tabs because multi-valued custom data group in profile
November 28, 2009, 06:12:25 am

thanx for donating money to the project :) u dont need to specify any special department in your request

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

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Cannot use tabs because multi-valued custom data group in profile
November 28, 2009, 11:06:12 am
Tim - Writing up a detailed description of your implementation and potentially providing folks a way to look at and learn from your code is another really important way of helping to support / sustain CiviCRM. You can do this in the Showcase forum board or by writing a blog post (which tends to be a bit more visible. (If you're up for doing a blog post, ping me and I'll give you blogging privileges on CiviCRM.org).

thx!
dave
Protect your investment in CiviCRM by  becoming a Member!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Profiles (Moderator: Dave Greenberg) »
  • Cannot use tabs because multi-valued custom data group in profile

This forum was archived on 2017-11-26.