By vit137 on
It seems pretty easy from this vantage to write an calendar module expressly for users. That is, any event a user adds to the calendar is only viewable to the user who wrote the event. I don't see one, so I'm wondering if it's more difficult than I believe. Does anybody have an opinion about this?
Comments
Here is a module that allows that
Take the code below, place in a file called private_event.module in a directory under modules called private_event.
Make sure under administer -> settings -> content you configure the 'private event' type so it shows in the calendar.
You will also need to grant the approriate permission for people to be able to create private events. There is also a permission that can be used to granted selected roles the ability to see all private events. Please let me know if this works for you (or if you have problems) as I plan to add this to Drupal in the next few days.
For those interested in how this works, it is a copy of basicevent plus the db_rewrite_sql hook which implements the logic to keep the event s private.
status
I've run into a problem. I installed it and, I thought, configured it, but here is what happens.
Click on create content -> private event
I see this message:
The event node is currently set to never appear in the calendar. You will not be able to set the start and end dates until an administrator changes the content-type settings. This is done using the event content-type settings page.
If I hit the link to the content-type settings page (/admin/settings/content-types/private+event) here are my relevant settings:
Default options:
Published
Promoted to front page
Show in event calendar is set to All views.
However, if as a regular user I just add an event to the calendar it shows up as it should (just for that user).
If I am part of a group, it saves the event, but does not display it on the calendar.
So it *almost* works as I have it set. Let me know what info you need about my set-up.
Troy
Fix for message, question on groups
The following will fix the error message
Just replace the same lines in private_event.module for the function private_event_form (I missed type the variable name to variable_get.
As for working with groups, are you using the og_event module or just the event module?
When you add it for a group is public checked or un-checked.
And did you select zero, one or possible more groups to add it for?
Not sure how well it groups as I have not tried that yet.
Re: Fix for message, question on groups
Thanks for the patch. Seems in good shape.
Yes I'm using og. Here's how I got it to work.
in:
admin/settings/og
Visibility of posts:
Doesn't seem to matter. I currently have it set to:
Visibility chosen by author/editor using a checkbox on the posting form. Checkbox defaults to Private.
Audience required:
Follows the same rule: doesn't matter. I currently have it set to:
optional
Omitted content types:
Does Matter. Omit private event and groups leaves it alone, private
events show up only on your private calendar (unless you're admin, then you
see them all).
Bottom line is, it seems to work great with OG. Thanks for creating this
module and all your help. If you need help with it in the future please
contact me.
Cheers,
Troy
birthday party
what if i am having a birthday party, it is a private event..but i need only the invited guys through email (rsvp) to see the details
thanks
http://www.i-bloggers.com
This is a valid question,
This is a valid question, have you got the answer? It will be very useful if the invitee can view the event without having to register as a member, maybe by using a one-time fixed password that can be given out in the invitation e-mail.
Worked but
Thanks alot
it worked, but how do you do the checkbox option ?
i did not get how do u make the vent group specific ?
Shouldn't this be a module
Shouldn't this be a module feature?
I think an event view should be configurable so that every user "owns" a calendar view. The event view calendar only displays events linked to that view. The user set as the owner of a view can decide who else may see it, based on roles, OGs or at user level.
--
Jakob Persson
Drupal developer, web designer and usability consultant
http://www.jakob-persson.com
--
Jakob Persson - blog
Leancept – Digital effect and innovation agency
5.11 Solution
I've been searching for a way to display only the events for the current user. I played with converting this code, but I'm thinking that basicevent's apparent deprecation might have made this option obsolete. Does anyone know if this is correct?
Rick Nashleanas
www.monarchdigital.com
Calendar
Here's what worked for me: http://drupal.org/node/133341 One of my filters was author is current user.
Rick Nashleanas
www.monarchdigital.com