Task #433
Feature #423: Update Theme
Feature #424: Events Theme Updates
Add Add Event button for SuperAdmin and Admin - Pre-populate with current group ID
| Status: | New | Start date: | 03/09/2012 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assignee: | % Done: | 0% |
||
| Category: | - | |||
| Target version: | - | |||
| Tag: | events |
Description
Add Add Event button for SuperAdmin and Admin to Group Events page and pre-populate with current group ID.
Line 129
// add events.js
add_action('wp_head', 'nycga_events_js');
function nycga_events_js()
{
?><script type="text/javascript" src="<?php echo bloginfo('stylesheet_directory') ?>/events.js"></script><?php
}
// allow site admins & group mods to attach eventsto a group,
// allow group to be changed or removed (by admin only, in dashboard only)
add_action('em_event_save_pre','nycga_group_event_save',2,1);
function nycga_group_event_save($EM_Event){
if( is_object($EM_Event) && !empty($_REQUEST['group_id']) && is_numeric($_REQUEST['group_id']) ){
//we have been requested an event creation tied to a group, so does this group exist, and does this person have admin rights to it?
if( current_user_can('manage_options') || groups_is_user_admin(get_current_user_id(), $_REQUEST['group_id']) || groups_is_user_mod(get_current_user_id(), $_REQUEST['group_id'])){
$EM_Event->group_id = $_REQUEST['group_id'];
}
}
if (is_admin() && current_user_can('manage_options') && empty($_POST['group_id']))
{
unset($EM_Event->group_id);
}
return $EM_Event;
}
History
Updated by Pea Lutz about 1 year ago
- Parent task changed from #279 to #424
Updated by Lippe Lippe about 1 year ago
- Tracker changed from 8 to Task