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) »
  • Display non-publiv events in Drupal calendar
Pages: [1]

Author Topic: Display non-publiv events in Drupal calendar  (Read 3711 times)

geo42

  • Guest
Display non-publiv events in Drupal calendar
March 30, 2008, 04:40:46 pm
I am using Drupal 5.x and CiviCRM.  I'm creating events using CiviEvent.  I have no problem displaying the public events on a Drupal calendar using the iCal feed exposed by CiviEvent.  However, is it possible to display non-public events on the calendar? I can list them in a block but I'd like them in a calendar view.  Can you possibly add a few parameters to the iCal URL to make non-public events appear?  Or via another way?  I just read about the Drupal CiviNode module and might give that a try.

Specifically, what I need to do is make non-public events display on the calendar if the logged in user is a member of a specific role, such as 'staff'.  Most users and anonymous guests would see the public events.   Members of the 'staff' role would additionally see things like staff meetings, report due dates, and other internal events. 

- John

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: Display non-publiv events in Drupal calendar
March 30, 2008, 04:52:58 pm

You cannot do this in v2.0 and prior.

I'm not sure if calendar caches any values, or if it loads the ical feed on every page load (i doubt it). I would first investigate the calendar module and check the behavior. If there is caching involved on the calendar end, your problem gets a bit more complicated and you need to figure out how to make it cache on a per role basis

If you are php coder, you can tweak the code in the foll files:

1. CRM/Event/Page/ICalendar.php, line 65

Code: [Select]
        $info = CRM_Event_BAO_Event::getCompleteInfo( $start, $type, $id );

and send in an argument and state if you are interested in public / non-public listings

2. CRM/Event/BAO/Event.php, line 530

Code: [Select]
      AND civicrm_event.is_public = 1                                                                                       

That is conditional based on the input argument.

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

geo42

  • Guest
Re: Display non-publiv events in Drupal calendar
March 30, 2008, 06:02:41 pm
Thanks for the quick response and the information.  I can do a little PHP and might experiment with the code you highlighted.  Do these functions have access to the Drupal global variables, such as userid and the like?  If so, maybe I can pass userid or actual role name into the CiviEvent code.  That is, as you suggest, only of the iCal feed is executed every time the page is accessed, which I doubt as well.  If caching is involved, then modifying the iCal feed may not be the way to go, but rather create code that exposes the civievents directly as drupal nodes so that Views has access to them. Worst case scenario is I create a staff-only block/page of events listed in table format.

Thanks again for your help.

- John

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Display non-publiv events in Drupal calendar
March 31, 2008, 03:17:54 pm
This blog post has detailed instructions for configuring Calendar / iCal and CiviEvent - and you can see in the iCal Tab screenshot that there is a Cache Expiration time setting which can be 0 sec. You'll have to experiment with this to see if it does the trick for your situation.

http://www.soleer.com/blog/2008/03/24/how-to-display-civicrm-events-on-a-drupal-calendar/
« Last Edit: March 31, 2008, 03:36:27 pm by Dave Greenberg »
Protect your investment in CiviCRM by  becoming a Member!

rampkrm

  • Guest
Re: Display non-publiv events in Drupal calendar
November 04, 2008, 03:26:27 am
Dave,

  the given instruction works only with drupal 5. can you tell me how can i import civievent ical feed to drupal calendar.

my server configures with
drupal 6.6
civicrm 2.1

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: Display non-publiv events in Drupal calendar
November 04, 2008, 06:44:48 am

we have not gotten this working in drupal6. calendar has changed its format etc

a community contribution and description to get this working would be great

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

dredbird

  • I post occasionally
  • **
  • Posts: 42
  • Karma: 0
Re: Display non-publiv events in Drupal calendar
November 20, 2008, 03:31:29 pm
Do I have this straight?: a civievent ical feed cannot be used to import a civievent event into the drupal calendar?

It's not just that i can't figure it out or find instructions?  (for Drupal 6.6 & CiviCRM 2.1.1)

 ???
My worst fear is that the rhythm really is going to get me.

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: Display non-publiv events in Drupal calendar
November 20, 2008, 03:51:16 pm

yes you have it straight :)

and if you do figure it out, please post back instructions on how 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

DaraghOBrien

  • Guest
Re: Display non-publiv events in Drupal calendar
February 19, 2009, 01:48:07 am
Lobo (& others)

Take a look over at http://drupal.org/node/215979?mode=2&sort=2. It looks like the solution to bringing ical event feeds into Calendar2.0 and Date2.0 in Drupal 6 is to create a custom event content type for that feed (possibly for each calendar feed), parse the feed into the event using feed api module and feed element mapper module and then include that content type in the view that populates calendar.

It looks like there is still some issues to be closed off in how feed element mapper actually parses ical feeds and (imho) it might be worth testing what they are producing with a civievent feed to make sure that all civievent fields can be mapped properly (I don't think there should be a problem but...).

Unfortunately I'm not in a position to patch the feed element mapper module on my dev environment at the moment so I can't test (yet).

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: Display non-publiv events in Drupal calendar
February 19, 2009, 06:40:53 am

thanx for keeping track of this and monitoring it. keep us updated on your experiments when you get the time to test and deploy it

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

DaraghOBrien

  • Guest
Re: Display non-publiv events in Drupal calendar
February 19, 2009, 08:22:53 am
Just so anyone doesn't waste time trying to create a copy of the calendar view and use the exposed CiviEvent elements as the source rather than the node type that is default in calendar, I've tried it and you can't change the view type.

@lobo - I suspect they are close to a fix. There's been a lot of activity in the past few days. Once there is a baselined dev version in HEAD I'll test it (unless someone else beats me to it). Unfortunately I can't apply patches on the hosting service I have, and things are a bit confusing as regards which patches to use with what at the moment.

I really need this for a project I'm working on (everything else between Drupal and Civi had synched up to meet 95% of the requirements at this stage... and then this... aaarrrrgh).

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • Display non-publiv events in Drupal calendar

This forum was archived on 2017-11-26.