I only anticipated having one type of event when I setup our school website, so I used the basic event type provided by the event module. But I don't know how to allow our teachers to edit events created by other teachers. I can see let them edit their own events via Access Control, but don't see the other option. Can this be done?

Alternately, is it possible to convert the nodes that have already been created as events to a new content type?

Comments

lsommerer’s picture

Version: 5.x-2.x-dev » 5.x-1.0

oops, I submitted this with the wrong version information. It should be 5.x-1.0

nancydru’s picture

The node module has a function: node_type_update_nodes($old_type, $type). Or you can do it in phpMyAdmin.

You can create another node type and specify that it is event-enabled. That will give you new access permissions that will allow you to grant the editing rights.

pheraph’s picture

Thanks, that helped to fix the problem. Is it possible to convert the existing events with the node-type "event" to my new node type?

nancydru’s picture

Yes, by the method I mentioned above.

modctek’s picture

Just curious, is this by design? ie. nodes of type 'event' will only ever be editable by the author?

NancyW, when you say "the method mentioned above" do you mean convert the existing nodes to the new node type via phpMyAdmin, or is there a way to do this through the GUI in the Administration menus of the Node module?

nancydru’s picture

I don't know of a GUI way to do it, but I have thought about writing it - it shouldn't be difficult.

You either need to create a little PHP page using the function I described, or go into PhpMyAdmin. Note that if you create a content type with CCK, you may not be able to do either method unless all the field names are identical.

I don't know if there are more permissions in Vers. 2. I have created two other event-enabled content types on my site ("Community" and "Holidays"). They do have "Edit" as well as "Edit own" permissions. So I guess the key is to not use the default content type and create a new one, then you can do what you want.

Jeff_Pflueger’s picture

I'm a bit fearful of creating a new node type and then converting all the events we have to that new type just to allow other people (other than the author and the admin) to edit any event.

Seems weird to me that events in the event module can only be edited by the author.

Is this a bug with the module or intentional?

How difficult to hack and change so that on the Access control page we have a check box that says "edit events" and allows that versus "Edit own events" ? If this is easy enough, I'd rather do that than create a new node type, etc etc

nancydru’s picture

Well, in version 2 there will be no "basicevent" so you can start practicing for creating your own content types now.

Faye-1’s picture

In the implementation of hook_perm(), I added an extra option 'edit all events':

function basicevent_perm() {
return array('create events', 'edit own events', 'edit all events');
}

and in the implementation of hook_access() I give access for updating or deleting of all events to users with 'edit all events' marked in the access control:

function basicevent_access($op, $node) {
global $user;
switch($op) {
case 'create':
return user_access('create events');
break;
case 'update':
case 'delete':
if ((user_access('edit own events') && ($user->uid == $node->uid)) or (user_access('edit all events'))) {
return TRUE;
}
break;
}
}

Normally this workaround should work.

Greetings, Faye

japerry’s picture

Status: Active » Closed (outdated)

Event for Drupal 8 is unrelated to older versions. If an issue similar to this one exists, please open a new issue with the 8.x branch.