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 CiviEvent (Moderator: Yashodha Chaku) »
  • Private Custom Data Groups or Fields
Pages: [1]

Author Topic: Private Custom Data Groups or Fields  (Read 1008 times)

geeffland

  • I’m new here
  • *
  • Posts: 29
  • Karma: 0
Private Custom Data Groups or Fields
March 27, 2010, 12:26:30 pm
Is there a built-in or easy way to have private custom data fields or groups for an event?  When I say private I am picturing data which can be seen or edited on the admin side but not visible in the Event Info screen.  I am thinking of things which you might want to track with an event that you don't want to share with participants, reservation numbers, internal contacts for the event, or other personal information that you want to keep with the event.

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: Private Custom Data Groups or Fields
March 27, 2010, 04:01:55 pm

not available right now :(

you can hide the custom fields from the info page (where they are displayed) using the pageRun hook potentially

however it would be a good feature to add to the system. i suspect this will need some schema changes to make it happen
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

geeffland

  • I’m new here
  • *
  • Posts: 29
  • Karma: 0
Re: Private Custom Data Groups or Fields
March 27, 2010, 04:34:25 pm
lobo,

Thanks again for the info.  You and Dave have been great about answering the many questions I have recently posted in various forums.

geeffland

  • I’m new here
  • *
  • Posts: 29
  • Karma: 0
Re: Private Custom Data Groups or Fields
March 27, 2010, 08:50:41 pm
OK for those interested, assuming you have a civicrmHooks.php file already setup for custom hooks here is the code I have that will remove or hide a Custom Data Group Titled "Internal Data" on the Event Info Page.

Code: [Select]
<?php
function 
joomla_civicrm_pageRun ( &$page ) {
switch (CRM_Utils_System::getClassName($page)) {
case 'CRM_Event_Page_EventInfo':
// follow code gets the Event ID if you want it... just remove the //
//$eventID = $page->get('id');

$template = &$page->getTemplate();
$eventCustomData = &$template->_tpl_vars['viewCustomData'];

$cdKeys = array_keys($eventCustomData);
foreach ($cdKeys as $arKey) {
$indivCustomData = current($eventCustomData[$arKey]);
if ($indivCustomData['title']=='Internal Data') {
unset($eventCustomData[$arKey]);
}
}
break;
default:
//print_r($page);
}
}
?>
« Last Edit: March 29, 2010, 08:51:37 am by geeffland »

geeffland

  • I’m new here
  • *
  • Posts: 29
  • Karma: 0
Re: Private Custom Data Groups or Fields
March 27, 2010, 08:54:27 pm
Probably a good way to put this in a future version of civiCRM would be to have a "Show on Event Info" property for the custom data group... then just not put that part in the array when building the Event Info data array.

ChrisChinchilla

  • I post occasionally
  • **
  • Posts: 104
  • Karma: 3
  • CiviCRM version: 4.1.2
  • CMS version: Drupal 6 & 7
Re: Private Custom Data Groups or Fields
May 10, 2010, 02:15:00 am
I just discovered one very quick way of solving this in Drupal if you don't want to show any of your custom data to the public, just use permissions... It will hide everything, but that might work for some people, I did for me.
Melbourne CiviCRM meetup group - http://www.meetup.com/MelbourneCiviCRM/

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • Private Custom Data Groups or Fields

This forum was archived on 2017-11-26.