From 0b25adcd921149b50845647980284e8ab66d8fed Mon Sep 17 00:00:00 2001 From: Kevin Jardine Date: Tue, 3 Apr 2012 12:31:42 +0200 Subject: major changes to add new features, including a full calendar and repeating events --- views/default/event_calendar/css.php | 98 +++++++++++++++++++++++++++++++++++- 1 file changed, 96 insertions(+), 2 deletions(-) (limited to 'views/default/event_calendar/css.php') diff --git a/views/default/event_calendar/css.php b/views/default/event_calendar/css.php index a2437e065..4d68f500f 100644 --- a/views/default/event_calendar/css.php +++ b/views/default/event_calendar/css.php @@ -171,8 +171,102 @@ li.event-calendar-filter-menu-show-only { margin-right: 10px; } -.event-calendar-date-time-setter label { +.event-calendar-medium-text { + width: 500px !important; +} + +.event-calendar-edit-form-block label { float: left; - width: 50px; + width: 90px; + margin-top: 5px; +} + +.event-calendar-long-text { + width: 500px !important; +} + +.event-calendar-edit-form-other-block .mceLayout { + width: 500px !important; +} + +.event-calendar-edit-form { + background-color: #FFFFFF; +} + +.event-calendar-edit-form-block { + width: 90%; + background-color: #DDDDDD; + border-width:1px; + border-style:solid; + border-color:#bfbfbf; + padding: 5px; + margin-bottom: 10px; + clear: both; +} + +.event-calendar-repeating-wrapper { + padding: 0; margin-top: 5px; +} +.event-calendar-repeating-unselected { + font-size: 16px; + font-weight: bold; + color: #DDDDDD; + background-color: #AAAAAA; + border: 1px solid #444444; + padding: 5px; + width: 25px; + text-align: center; + display: inline-block; + margin: 0; +} + +.event-calendar-repeating-unselected:hover { + text-decoration: none; +} + +.event-calendar-repeating-selected { + font-size: 16px; + font-weight: bold; + color: #000000; + background-color: #FFFFFF; + border: 1px solid #000000; + padding: 5px; + width: 25px; + text-align: center; + display: inline-block; + margin: 0; +} + +.event-calendar-repeating-selected:hover { + text-decoration: none; + color: #CCCCCC; +} + +.event-calendar-edit-form-schedule-block ul.elgg-vertical li { + display: block !important; + clear: both; +} + +.event-calendar-edit-form-block ul.elgg-vertical li label { + font-weight: normal; + width: 500px; +} + +.event-calendar-edit-form-block h2 { + font-size: 18px; + color: #000000; +} + +.event-calendar-edit-date-wrapper { + clear: both; + margin-left: 20px; +} + +.event-calendar-edit-reminder-wrapper { + margin-top: 10px; +} + +.event-calendar-description { + display: none; } \ No newline at end of file -- cgit v1.2.3 From b8c3767f8c790febb35141919936d616d3ebe2d4 Mon Sep 17 00:00:00 2001 From: Kevin Jardine Date: Thu, 24 May 2012 20:00:18 +0200 Subject: changed time handling and added more suppport for event polls --- languages/en.php | 5 + models/model.php | 225 ++++++++++++++------- start.php | 1 + views/default/event_calendar/css.php | 7 +- views/default/event_calendar/datetime_edit.php | 12 +- .../default/event_calendar/full_calendar_view.php | 2 +- .../event_calendar/personal_manage_section.php | 20 ++ views/default/event_calendar/reminder_section.php | 28 +++ views/default/event_calendar/schedule_section.php | 22 ++ views/default/event_calendar/share_section.php | 26 +++ views/default/forms/event_calendar/edit.php | 110 +++------- views/default/input/datepicker_inline.php | 3 +- views/default/input/timepicker.php | 90 +++------ views/default/js/event_calendar/event_calendar.php | 24 +++ 14 files changed, 345 insertions(+), 230 deletions(-) create mode 100644 views/default/event_calendar/personal_manage_section.php create mode 100644 views/default/event_calendar/reminder_section.php create mode 100644 views/default/event_calendar/schedule_section.php create mode 100644 views/default/event_calendar/share_section.php (limited to 'views/default/event_calendar/css.php') diff --git a/languages/en.php b/languages/en.php index 5f060748c..782cd7a72 100644 --- a/languages/en.php +++ b/languages/en.php @@ -290,6 +290,7 @@ You can manage calendar requests for this event here: 'event_calendar:site_calendar' => "Site-wide calendar", 'event_calendar:calendar_label' => "Calendar", 'event_calendar:calendar_description' => "Calendar for this event.", + 'event_calendar:are_you_sure' => "Are you sure about this change?", 'event_calendar:schedule:header' => "Schedule", 'event_calendar:permissions:header' => "Permissions", 'event_calendar:read_access' => "Read access", @@ -298,6 +299,9 @@ You can manage calendar requests for this event here: 'event_calendar:share_ownership:description' => "Allow the following people to edit or delete this event, invite participants, etc.", 'event_calendar:settings:fewer_fields:title' => "Hide fees, contact, organiser and long description fields", 'event_calendar:settings:restricted_times:title' => "Restricted time to between 6am and 9pm (6:00 and 21:00)", + 'event_calendar:add_event' => "Add event", + 'event_calendar:schedule_event' => "Schedule event", + 'event_calendar:list_polls' => "List event polls", 'event_calendar:edit_form:error:missing_title' => "Error: please supply the missing title.", 'event_calendar:repeated_event:week_interval' => "every %s weeks.", 'event_calendar:repeated_event:week_single' => "every week.", @@ -305,6 +309,7 @@ You can manage calendar requests for this event here: 'event_calendar:settings:repeated_events:title' => "Allow repeated events (currently only works properly in full calendar mode)", 'event_calendar:settings:reminders:title' => "Allow sending reminders", 'event_calendar:reminder:subject' => "Reminder for event: %s", + 'event_calendar:poll_suffix' => "(poll)", 'event_calendar:reminder:body' => "The event %s diff --git a/models/model.php b/models/model.php index 042d21736..7de514802 100644 --- a/models/model.php +++ b/models/model.php @@ -22,6 +22,22 @@ function event_calendar_get_event_for_edit($event_id) { } } +// converts to time in minutes since midnight +function event_calendar_convert_to_time($hour,$minute,$meridian) { + if ($meridian) { + if ($meridian == 'am') { + if ($hour == 12) { + $hour = 0; + } + } else { + if ($hour < 12) { + $hour += 12; + } + } + } + return 60*$hour+$minute; +} + // returns the event or FALSE function event_calendar_set_event_from_form($event_guid,$group_guid) { @@ -33,6 +49,7 @@ function event_calendar_set_event_from_form($event_guid,$group_guid) { $event_calendar_more_required = elgg_get_plugin_setting('more_required', 'event_calendar'); $event_calendar_personal_manage = elgg_get_plugin_setting('personal_manage', 'event_calendar'); $event_calendar_repeating_events = elgg_get_plugin_setting('repeating_events', 'event_calendar'); + $schedule_type = get_input('schedule_type'); if ($event_calendar_more_required == 'yes') { $required_fields = array('title','venue','start_date', @@ -80,41 +97,47 @@ function event_calendar_set_event_from_form($event_guid,$group_guid) { $event->description = get_input('description'); $event->venue = get_input('venue'); - $start_date = get_input('start_date'); - $event->original_start_date = get_input('start_date'); - //$end_date = trim(get_input('end_date','')); - // convert start date from current server time to GMT - $start_date_text = gmdate("Y-m-d",$start_date); - //$event->munged_start_date_string = $start_date_text." ".date_default_timezone_get(); - - $event->start_date = strtotime($start_date_text." ".date_default_timezone_get()); - $end_date = trim(get_input('end_date','')); - $event->original_end_date = get_input('end_date'); - if ($end_date) { - $end_date_text = gmdate("Y-m-d",$end_date); - $event->end_date = strtotime($end_date_text." ".date_default_timezone_get()); - //$event->munged_end_date_string = $end_date_text." ".date_default_timezone_get(); - } else { - $event->end_date = ''; - } - - if ($event_calendar_times != 'no') { - $st = get_input('start_time',''); - if (is_numeric($st)) { - $event->start_time = $st; - } else { - $event->start_time = ''; - } - $et = get_input('end_time',''); - if (is_numeric($et)) { - $event->end_time = $et; + if ($schedule_type != 'poll') { + $start_date_text = trim(get_input('start_date')); + /*$event->original_start_date = get_input('start_date'); + //$end_date = trim(get_input('end_date','')); + // convert start date from current server time to GMT + $start_date_text = gmdate("Y-m-d",$start_date); + //$event->munged_start_date_string = $start_date_text." ".date_default_timezone_get();*/ + + // TODO: is the timezone bit necessary? + $event->start_date = strtotime($start_date_text." ".date_default_timezone_get()); + $end_date_text = trim(get_input('end_date','')); + //$event->original_end_date = get_input('end_date'); + if ($end_date_text) { + $event->end_date = strtotime($end_date_text." ".date_default_timezone_get()); + //$event->munged_end_date_string = $end_date_text." ".date_default_timezone_get(); } else { - $event->end_time = ''; + $event->end_date = ''; } - if (is_numeric($event->start_time)) { - // Set start date to the Unix start time, if set. - // This allows sorting by date *and* time. - $event->start_date += $event->start_time*60; + + if ($event_calendar_times != 'no') { + $hour = get_input('start_time_hour',''); + $minute = get_input('start_time_minute',''); + $meridian = get_input('start_time_meridian',''); + if (is_numeric($hour) && is_numeric($minute)) { + $event->start_time = event_calendar_convert_to_time($hour,$minute,$meridian); + } else { + $event->start_time = ''; + } + $hour = get_input('end_time_hour',''); + $minute = get_input('end_time_minute',''); + $meridian = get_input('end_time_meridian',''); + if (is_numeric($hour) && is_numeric($minute)) { + $event->end_time = event_calendar_convert_to_time($hour,$minute,$meridian); + } else { + $event->end_time = ''; + } + if (is_numeric($event->start_date) && is_numeric($event->start_time)) { + // Set start date to the Unix start time, if set. + // This allows sorting by date *and* time. + $event->start_date += $event->start_time*60; + } } } if ($event_calendar_spots_display == 'yes') { @@ -147,8 +170,7 @@ function event_calendar_set_event_from_form($event_guid,$group_guid) { $event->organiser = get_input('organiser'); $event->tags = string_to_tag_array(get_input('tags')); $event->long_description = get_input('long_description'); - $event->all_day = get_input('all_day'); - $event->schedule_type = get_input('schedule_type'); + $event->schedule_type = $schedule_type; $event->send_reminder = get_input('send_reminder'); $event->reminder_number = get_input('reminder_number'); $event->reminder_interval = get_input('reminder_interval'); @@ -193,7 +215,8 @@ function event_calendar_set_event_from_form($event_guid,$group_guid) { return $event; } -function event_calendar_get_events_between($start_date,$end_date,$is_count=FALSE,$limit=10,$offset=0,$container_guid=0,$region='-') { +function event_calendar_get_events_between($start_date,$end_date,$is_count=FALSE,$limit=10,$offset=0,$container_guid=0,$region='-') { + $polls_supported = elgg_is_active_plugin('event_poll'); if ($is_count) { $count = event_calendar_get_entities_from_metadata_between2('start_date','end_date', $start_date, $end_date, "object", "event_calendar", 0, $container_guid, $limit,$offset,"",0,false,true,$region); @@ -203,6 +226,11 @@ function event_calendar_get_events_between($start_date,$end_date,$is_count=FALSE $start_date, $end_date, "object", "event_calendar", 0, $container_guid, $limit,$offset,"",0,false,false,$region); $repeating_events = event_calendar_get_repeating_events_between($start_date,$end_date,$container_guid,$region); $all_events = event_calendar_merge_repeating_events($events, $repeating_events); + if ($polls_supported) { + elgg_load_library('elgg:event_poll'); + $all_events = event_poll_merge_poll_events($all_events,$start_date,$end_date); + } + return $all_events; } } @@ -1204,10 +1232,12 @@ function event_calendar_get_formatted_full_items($event) { $event_calendar_region_display = elgg_get_plugin_setting('region_display', 'event_calendar'); $event_calendar_type_display = elgg_get_plugin_setting('type_display', 'event_calendar'); $event_items = array(); - $item = new stdClass(); - $item->title = elgg_echo('event_calendar:when_label'); - $item->value = $time_bit; - $event_items[] = $item; + if ($time_bit) { + $item = new stdClass(); + $item->title = elgg_echo('event_calendar:when_label'); + $item->value = $time_bit; + $event_items[] = $item; + } $item = new stdClass(); $item->title = elgg_echo('event_calendar:venue_label'); $item->value = htmlspecialchars($event->venue); @@ -1244,6 +1274,9 @@ function event_calendar_get_formatted_full_items($event) { } function event_calendar_get_formatted_time($event) { + if (!$event->start_date) { + return ''; + } $date_format = 'j M Y'; $event_calendar_times = elgg_get_plugin_setting('times', 'event_calendar') != 'no'; @@ -1448,18 +1481,9 @@ function event_calendar_get_page_content_list($page_type,$container_guid,$start_ elgg_push_context('groups'); elgg_set_page_owner_guid($container_guid); $user_guid = elgg_get_logged_in_user_guid(); - $group_calendar = elgg_get_plugin_setting('group_calendar', 'event_calendar'); - if (!$group_calendar || $group_calendar == 'members') { - if (elgg_get_page_owner_entity()->canWriteToContainer($user_guid)){ - elgg_register_menu_item('title', array( - 'name' => 'add', - 'href' => "event_calendar/add/".$container_guid, - 'text' => elgg_echo('event_calendar:add'), - 'class' => 'elgg-button elgg-button-action', - )); - } - } else if ($group_calendar == 'admin') { - if (elgg_is_admin_logged_in() || ($group->owner_guid == $user_guid)) { + // TODO - ideally avoid the check on the event_poll plugin, perhaps by having event_poll remove the menu item + if(event_calendar_can_add($container_guid)) { + if (!elgg_plugin_exists('event_poll')) { elgg_register_menu_item('title', array( 'name' => 'add', 'href' => "event_calendar/add/".$container_guid, @@ -1470,20 +1494,9 @@ function event_calendar_get_page_content_list($page_type,$container_guid,$start_ } } else { elgg_push_breadcrumb(elgg_echo('item:object:event_calendar')); - $site_calendar = elgg_get_plugin_setting('site_calendar', 'event_calendar'); - if (!$site_calendar || $site_calendar == 'admin') { - // only admins can post directly to the site-wide calendar - if (elgg_is_admin_logged_in()) { - elgg_register_menu_item('title', array( - 'name' => 'add', - 'href' => "event_calendar/add", - 'text' => elgg_echo('event_calendar:add'), - 'class' => 'elgg-button elgg-button-action', - )); - } - } else if ($site_calendar == 'loggedin') { - // any logged-in user can post to the site calendar - if (elgg_is_logged_in()) { + $user_guid = elgg_get_logged_in_user_guid(); + if(event_calendar_can_add($container_guid)) { + if (!elgg_plugin_exists('event_poll')) { elgg_register_menu_item('title', array( 'name' => 'add', 'href' => "event_calendar/add", @@ -1535,7 +1548,7 @@ function event_calendar_get_page_content_edit($page_type,$guid) { $event = get_entity((int)$guid); if (elgg_instanceof($event, 'object', 'event_calendar') && $event->canEdit()) { $body_vars['event'] = $event; - $body_vars['form_data'] = event_calendar_prepare_edit_form_vars($event); + $body_vars['form_data'] = event_calendar_prepare_edit_form_vars($event,$page_type); $event_container = get_entity($event->container_guid); if (elgg_instanceof($event_container, 'group')) { @@ -1554,6 +1567,7 @@ function event_calendar_get_page_content_edit($page_type,$guid) { } } else { $title = elgg_echo('event_calendar:add_event_title'); + if ($guid) { // add to group $group = get_entity($guid); @@ -1561,7 +1575,7 @@ function event_calendar_get_page_content_edit($page_type,$guid) { $body_vars['group_guid'] = $guid; elgg_push_breadcrumb(elgg_echo('event_calendar:group_breadcrumb'), 'event_calendar/group/'.$guid); elgg_push_breadcrumb(elgg_echo('event_calendar:add_event_title')); - $body_vars['form_data'] = event_calendar_prepare_edit_form_vars(); + $body_vars['form_data'] = event_calendar_prepare_edit_form_vars(NULL,$page_type); $content = elgg_view_form('event_calendar/edit', $vars, $body_vars); } else { $content = elgg_echo('event_calendar:no_group'); @@ -1571,7 +1585,7 @@ function event_calendar_get_page_content_edit($page_type,$guid) { elgg_push_breadcrumb(elgg_echo('event_calendar:show_events_title'),'event_calendar/list'); elgg_push_breadcrumb(elgg_echo('event_calendar:add_event_title')); - $body_vars['form_data'] = event_calendar_prepare_edit_form_vars(); + $body_vars['form_data'] = event_calendar_prepare_edit_form_vars(NULL,$page_type); $content = elgg_view_form('event_calendar/edit', $vars, $body_vars); } @@ -1590,17 +1604,22 @@ function event_calendar_get_page_content_edit($page_type,$guid) { * @param ElggObject $event * @return array */ -function event_calendar_prepare_edit_form_vars($event = NULL) { +function event_calendar_prepare_edit_form_vars($event = NULL, $page_type = '') { // input names => defaults + $now = time(); + $iso_date = date('Y-m-d',$now); + $now_midnight = strtotime($iso_date); + $start_time = floor(($now-$now_midnight)/60) + 60; + $start_time = floor($start_time/5)*5; $values = array( 'title' => NULL, 'description' => NULL, 'venue' => NULL, - 'start_date' => NULL, - 'end_date' => NULL, - 'start_time' => NULL, - 'end_time' => NULL, + 'start_date' => $now+60*60, + 'end_date' => $now+2*60*60, + 'start_time' => $start_time, + 'end_time' => $start_time + 60, 'spots' => NULL, 'region' => '-', 'event_type' => '-', @@ -1608,11 +1627,9 @@ function event_calendar_prepare_edit_form_vars($event = NULL) { 'contact' => NULL, 'organiser' => NULL, 'tags' => NULL, - 'all_day' => 0, 'send_reminder' => NULL, 'reminder_number' => 1, 'reminder_interval' => 60, - 'schedule_type' => 'fixed', 'repeats' => NULL, 'repeat_interval' => 1, 'event-calendar-repeating-monday-value' => 0, @@ -1628,6 +1645,12 @@ function event_calendar_prepare_edit_form_vars($event = NULL) { 'access_id' => ACCESS_DEFAULT, 'group_guid' => NULL, ); + + if ($page_type == 'schedule') { + $values['schedule_type'] = 'poll'; + } else { + $values['schedule_type'] = 'fixed'; + } if ($event) { foreach (array_keys($values) as $field) { @@ -2102,6 +2125,7 @@ function event_calendar_get_page_content_fullcalendar_events($start_date,$end_da } $event_array = array(); $times_supported = elgg_get_plugin_setting('times','event_calendar') != 'no'; + $polls_supported = elgg_plugin_exists('event_poll'); foreach($events as $e) { $event = $e['event']; $event_data = $e['data']; @@ -2115,11 +2139,16 @@ function event_calendar_get_page_content_fullcalendar_events($start_date,$end_da 'start' => date('c',$ed['start_time']), 'end' => date('c',$ed['end_time']), ); - if (!$times_supported || $event->all_day) { + if (!$times_supported || ($event->schedule_type == 'all_day')) { $event_item['allDay'] = TRUE; } else { $event_item['allDay'] = FALSE; } + + if ($polls_supported && isset($e['is_event_poll']) && $e['is_event_poll']) { + $event_item['className'] = 'event-poll-class'; + $event_item['title'] .= ' '.elgg_echo('event_calendar:poll_suffix'); + } $event_array[] = $event_item; } @@ -2298,3 +2327,45 @@ function event_calendar_get_join_bbb_url($event) { return $url; } +// returns TRUE if the given user can add an event to the given calendar +// if group_guid is 0, this is assumed to be the site calendar +function event_calendar_can_add($group_guid=0,$user_guid=0) { + if (!$user_guid) { + if (elgg_is_logged_in()) { + $user_guid = elgg_get_logged_in_user_guid(); + } else { + return FALSE; + } + } + if ($group_guid) { + if (!event_calendar_activated_for_group($group_guid)) { + return FALSE; + } + $group = get_entity($group_guid); + if (elgg_instanceof($group,'group')) { + $group_calendar = elgg_get_plugin_setting('group_calendar', 'event_calendar'); + if (!$group_calendar || $group_calendar == 'members') { + return $group->canWriteToContainer($user_guid); + } else if ($group_calendar == 'admin') { + if ($group->canEdit($user_guid)) { + return TRUE; + } else { + return FALSE; + } + } + } else { + return FALSE; + } + } else { + $site_calendar = elgg_get_plugin_setting('site_calendar', 'event_calendar'); + if (!$site_calendar || $site_calendar == 'admin') { + // only admins can post directly to the site-wide calendar + return elgg_is_admin_user($user_guid); + } else if ($site_calendar == 'loggedin') { + // any logged-in user can post to the site calendar + return TRUE; + } + } + + return FALSE; +} diff --git a/start.php b/start.php index 4c17c719b..c9f95c8d6 100644 --- a/start.php +++ b/start.php @@ -190,6 +190,7 @@ function event_calendar_page_handler($page) { case 'manage_users': echo event_calendar_get_page_content_manage_users($page[1]); break; + case 'schedule': case 'add': if (isset($page[1])) { group_gatekeeper(); diff --git a/views/default/event_calendar/css.php b/views/default/event_calendar/css.php index 4d68f500f..9461a7fe9 100644 --- a/views/default/event_calendar/css.php +++ b/views/default/event_calendar/css.php @@ -269,4 +269,9 @@ li.event-calendar-filter-menu-show-only { .event-calendar-description { display: none; -} \ No newline at end of file +} + +.event-calendar-edit-bottom { + clear: both; + margin-bottom: 5px; +} diff --git a/views/default/event_calendar/datetime_edit.php b/views/default/event_calendar/datetime_edit.php index aa3a8f2de..ceceeb20e 100644 --- a/views/default/event_calendar/datetime_edit.php +++ b/views/default/event_calendar/datetime_edit.php @@ -9,16 +9,16 @@ if ($event_calendar_times != 'no') { $body .= '

'; } $body .= elgg_view("event_calendar/input/date_local",array( - 'timestamp'=>TRUE, + //'timestamp'=>TRUE, 'autocomplete'=>'off', 'class'=>'event-calendar-compressed-date', 'name' => 'start_date', 'value'=>$vars['start_date'])); $body .= elgg_view("input/timepicker",array('name' => 'start_time','value'=>$vars['start_time'])); if ($event_calendar_hide_end != 'yes') { - $body .= '

'; + $body .= '

'; $body .= elgg_view("event_calendar/input/date_local",array( - 'timestamp'=>TRUE, + //'timestamp'=>TRUE, 'autocomplete'=>'off', 'class'=>'event-calendar-compressed-date', 'name' => 'end_date', @@ -26,7 +26,7 @@ if ($event_calendar_times != 'no') { )); $body .= elgg_view("input/timepicker",array('name' => 'end_time','value'=>$vars['end_time'])); } - $body .= '

'; + $body .= '

'; } else { $body .= '

'.$prefix['start_date'].elgg_echo('event_calendar:start_date_description').'

'; if ($event_calendar_hide_end != 'yes') { - $body .= '

'; - $body .= '

'.$prefix['end_date'].elgg_echo('event_calendar:end_date_description').'

'; + //$body .= '

'.$prefix['end_date'].elgg_echo('event_calendar:end_date_description').'

'; } } diff --git a/views/default/event_calendar/full_calendar_view.php b/views/default/event_calendar/full_calendar_view.php index 6c21c42c8..5fffff624 100644 --- a/views/default/event_calendar/full_calendar_view.php +++ b/views/default/event_calendar/full_calendar_view.php @@ -14,7 +14,7 @@ handleEventClick = function(event) { handleEventDrop = function(event,dayDelta,minuteDelta,allDay,revertFunc) { - if (!confirm("Are you sure about this change?")) { + if (!confirm("")) { revertFunc(); } else { elgg.action('event_calendar/modify_full_calendar', diff --git a/views/default/event_calendar/personal_manage_section.php b/views/default/event_calendar/personal_manage_section.php new file mode 100644 index 000000000..9e03db0ab --- /dev/null +++ b/views/default/event_calendar/personal_manage_section.php @@ -0,0 +1,20 @@ + 'open', + elgg_echo('event_calendar:personal_manage:by_event:closed') => 'closed', + elgg_echo('event_calendar:personal_manage:by_event:private') => 'private', + ); + $body .= '
'; + $body .= '

'.elgg_echo('event_calendar:personal_manage:label').'

'; + $body .= elgg_view("input/radio",array('name' => 'personal_manage','value'=>$fd['personal_manage'],'options'=>$personal_manage_options)); + //$body .= '

'.$prefix['personal_manage'].elgg_echo('event_calendar:personal_manage:description').'

'; + $body .= '
'; + $body .= '
'; +} + +echo $body; diff --git a/views/default/event_calendar/reminder_section.php b/views/default/event_calendar/reminder_section.php new file mode 100644 index 000000000..fffa6d065 --- /dev/null +++ b/views/default/event_calendar/reminder_section.php @@ -0,0 +1,28 @@ +'; + if ($fd['send_reminder']) { + $body .= elgg_view('input/checkbox',array('name'=>'send_reminder','checked' => 'checked','value'=>1)); + } else { + $body .= elgg_view('input/checkbox',array('name'=>'send_reminder','value'=>1)); + } + $body .= elgg_echo('elgg_calendar:send_reminder_label'). ' '; + $numbers = array(); + for ($i=1;$i<60;$i++) { + $numbers[$i] = $i; + } + $intervals = array( + 1 => elgg_echo('event_calendar:interval:minute'), + 60 => elgg_echo('event_calendar:interval:hour'), + 60*24 => elgg_echo('event_calendar:interval:day'), + ); + + $body .= elgg_view('input/dropdown',array('name'=>'reminder_number','options_values'=>$numbers,'value'=>$fd['reminder_number'])); + $body .= elgg_view('input/dropdown',array('name'=>'reminder_interval','options_values'=>$intervals,'value'=>$fd['reminder_interval'])); + $body .= elgg_echo('elgg_calendar:send_reminder_before'); + $body .= ''; +} +echo $body; diff --git a/views/default/event_calendar/schedule_section.php b/views/default/event_calendar/schedule_section.php new file mode 100644 index 000000000..3a74dc789 --- /dev/null +++ b/views/default/event_calendar/schedule_section.php @@ -0,0 +1,22 @@ +'; +$body .= elgg_view('event_calendar/datetime_edit', + array( + 'start_date' => $fd['start_date'], + 'end_date' => $fd['end_date'], + 'start_time' => $fd['start_time'], + 'end_time' => $fd['end_time'], + 'prefix' => $vars['prefix'], +)); +if ($event_calendar_repeated_events == 'yes') { + $body .= elgg_view('event_calendar/repeat_form_element',$vars); +} + +$body .= elgg_view('event_calendar/reminder_section',$vars); +$body .= ''; + +echo $body; diff --git a/views/default/event_calendar/share_section.php b/views/default/event_calendar/share_section.php new file mode 100644 index 000000000..134f07656 --- /dev/null +++ b/views/default/event_calendar/share_section.php @@ -0,0 +1,26 @@ +'; +$body .= '

'.elgg_echo('event_calendar:permissions:header').'

'; +if($event_calendar_hide_access == 'yes') { + $event_calendar_default_access = elgg_get_plugin_setting('default_access', 'event_calendar'); + if($event_calendar_default_access) { + $body .= elgg_view("input/hidden",array('name' => 'access_id','value'=>$event_calendar_default_access)); + } else { + $body .= elgg_view("input/hidden",array('name' => 'access_id','value'=>ACCESS_DEFAULT)); + } +} else { + $body .= '

'; + $body .= elgg_view("input/access",array('name' => 'access_id','value'=>$fd['access_id'])); + $body .= '

'; +} +if (elgg_plugin_exists('entity_admins')) { + $body .= elgg_echo('event_calendar:share_ownership:label'); + $body .= '
'; + $body .= elgg_echo('event_calendar:share_ownership:description'); + $body .= elgg_view('input/entity_admins_dropdown',array('entity'=>$vars['event'])); +} +$body .= ''; + +echo $body; diff --git a/views/default/forms/event_calendar/edit.php b/views/default/forms/event_calendar/edit.php index 278fdddce..6ea06a6b4 100644 --- a/views/default/forms/event_calendar/edit.php +++ b/views/default/forms/event_calendar/edit.php @@ -2,17 +2,15 @@ $event = $vars['event']; $fd = $vars['form_data']; -$personal_manage_options = array( - elgg_echo('event_calendar:personal_manage:by_event:open') => 'open', - elgg_echo('event_calendar:personal_manage:by_event:closed') => 'closed', - elgg_echo('event_calendar:personal_manage:by_event:private') => 'private', -); - $schedule_options = array( - elgg_echo('event_calendar:schedule_type:poll')=>'poll', + elgg_echo('event_calendar:all_day_label') => 'all_day', elgg_echo('event_calendar:schedule_type:fixed')=>'fixed', ); +if (elgg_plugin_exists('event_poll')) { + $schedule_options = array_merge(array(elgg_echo('event_calendar:schedule_type:poll')=>'poll'),$schedule_options); +} + $event_calendar_fewer_fields = elgg_get_plugin_setting('fewer_fields', 'event_calendar'); $event_calendar_repeating_events = elgg_get_plugin_setting('repeating_events', 'event_calendar'); @@ -20,12 +18,8 @@ $event_calendar_region_display = elgg_get_plugin_setting('region_display', 'even $event_calendar_type_display = elgg_get_plugin_setting('type_display', 'event_calendar'); $event_calendar_spots_display = elgg_get_plugin_setting('spots_display', 'event_calendar'); //$event_calendar_add_users = elgg_get_plugin_setting('add_users', 'event_calendar'); -$event_calendar_hide_access = elgg_get_plugin_setting('hide_access', 'event_calendar'); $event_calendar_more_required = elgg_get_plugin_setting('more_required', 'event_calendar'); -$event_calendar_personal_manage = elgg_get_plugin_setting('personal_manage', 'event_calendar'); -$event_calendar_repeated_events = elgg_get_plugin_setting('repeated_events', 'event_calendar'); -$event_calendar_reminders = elgg_get_plugin_setting('reminders', 'event_calendar'); $event_calendar_bbb_server_url = elgg_get_plugin_setting('bbb_server_url', 'event_calendar'); if ($event_calendar_more_required == 'yes') { @@ -49,53 +43,6 @@ foreach ($all_fields as $fn) { } if ($event) { - /*$title = $event->title; - $brief_description = $event->description; - $venue = $event->venue; - // this is a form redisplay, so take the values as submitted - $start_date = $event->start_date; - $end_date = $event->end_date; - - if ($event_calendar_region_display) { - $region = $event->region; - if (!$region) { - $region = '-'; - } - } - - if ($event_calendar_spots_display) { - $spots = trim($event->spots); - } - if ($event_calendar_type_display) { - $event_type = $event->event_type; - if (!$event_type) { - $event_type = '-'; - } - } - $fees = $event->fees; - $contact = $event->contact; - $organiser = $event->organiser; - if ($event->tags) { - $event_tags = $event->tags; - } else { - // old way - $event_tags = $event->event_tags; - } - $reminder_number = $event->reminder_number; - $reminder_interval = $event->reminder_interval; - - $long_description = $event->long_description; - $access = $event->access_id; - if ($event_calendar_times != 'no') { - $start_time = $event->start_time; - $end_time = $event->end_time; - } - if ($event_calendar_personal_manage == 'by_event') { - $personal_manage = $event->personal_manage; - if (!$personal_manage) { - $personal_manage = 'open'; - } - }*/ $event_action = 'manage_event'; $event_guid = $event->guid; } else { @@ -106,8 +53,7 @@ if ($event) { $title = $fd['title']; $brief_description = $fd['description']; $venue = $fd['venue']; -$start_date = $fd['start_date']; -$end_date = $fd['end_date']; + $fees = $fd['fees']; if ($event_calendar_spots_display) { $spots = $fd['spots']; @@ -122,19 +68,16 @@ $contact = $fd['contact']; $organiser = $fd['organiser']; $event_tags = $fd['tags']; $all_day = $fd['all_day']; -$send_reminder = $fd['send_reminder']; -$reminder_number = $fd['reminder_number']; -$reminder_interval = $fd['reminder_interval']; $schedule_type = $fd['schedule_type']; $long_description = $fd['long_description']; -$access = $fd['access_id']; -if ($event_calendar_times != 'no') { + +/*if ($event_calendar_times != 'no') { $start_time = $fd['start_time']; $end_time = $fd['end_time']; } if ($event_calendar_personal_manage == 'by_event') { $personal_manage = $fd['personal_manage']; -} +}*/ $body = '
'; @@ -187,15 +130,11 @@ $body .= '
'; $body .= '
'; $body .= '

'.elgg_echo('event_calendar:schedule:header').'

'; -if ($all_day) { - $body .= elgg_view('input/checkbox',array('name'=>'all_day','value'=>1,'checked'=>'checked')); -} else { - $body .= elgg_view('input/checkbox',array('name'=>'all_day','value'=>1)); -} -$body .= elgg_echo('event_calendar:all_day_label'); -if(elgg_plugin_exists('event_poll')) { - $body .= elgg_view('input/radio',array('name'=>'schedule_type','value'=>$schedule_type,'options'=>$schedule_options)); -} +$body .= elgg_view('input/radio',array('id'=>'event-calendar-edit-schedule-type','name'=>'schedule_type','value'=>$schedule_type,'options'=>$schedule_options)); + +$vars['prefix'] = $prefix; + +/* $body .= '
'; $body .= elgg_view('event_calendar/datetime_edit', array( @@ -230,7 +169,9 @@ if ($event_calendar_reminders == 'yes') { $body .= elgg_view('input/dropdown',array('name'=>'reminder_interval','options_values'=>$intervals,'value'=>$reminder_interval)); $body .= elgg_echo('elgg_calendar:send_reminder_before'); $body .= '
'; -} +}*/ + +$body .= elgg_view('event_calendar/schedule_section',$vars); if ($event_calendar_spots_display == 'yes') { $body .= '

'; $body .= '

'.$prefix['spots'].elgg_echo('event_calendar:spots_description').'

'; } -$body .= '
'; + +$body .= '
'; $body .= ''; // the following feature has been superceded by the manage subscribers feature @@ -250,23 +192,27 @@ $body .= ''; $body .= '

'.elgg_echo('event_calendar:add_user_description').'

'; }*/ -if ($event_calendar_personal_manage == 'by_event') { +$body .= elgg_view('event_calendar/personal_manage_section',$vars); + +/*if ($event_calendar_personal_manage == 'by_event') { $body .= '
'; $body .= '

'.elgg_echo('event_calendar:personal_manage:label').'

'; $body .= elgg_view("input/radio",array('name' => 'personal_manage','value'=>$personal_manage,'options'=>$personal_manage_options)); //$body .= '

'.$prefix['personal_manage'].elgg_echo('event_calendar:personal_manage:description').'

'; $body .= '
'; $body .= '
'; -} +}*/ -$body .= '';*/ if ($event_calendar_region_display == 'yes' || $event_calendar_type_display == 'yes' || $event_calendar_fewer_fields != 'yes') { $body .= '
'; diff --git a/views/default/input/datepicker_inline.php b/views/default/input/datepicker_inline.php index 1d0a0689d..3fd9c37af 100644 --- a/views/default/input/datepicker_inline.php +++ b/views/default/input/datepicker_inline.php @@ -65,7 +65,6 @@ $("#").datepicker({ document.location.href = "".replace('%s', date.substring(0,10)); }, dateFormat: "yy-mm-dd", - defaultDate: "", beforeShowDay: highlightWeek }); @@ -76,7 +75,7 @@ if ("" == "month") { end_date += 1; } $("#").datepicker("setDate", start_date, end_date); -var done_loading = true; +done_loading = true; }); diff --git a/views/default/input/timepicker.php b/views/default/input/timepicker.php index ccbb88778..2cc95ced7 100644 --- a/views/default/input/timepicker.php +++ b/views/default/input/timepicker.php @@ -1,5 +1,4 @@ 'am','pm'=>'pm'); + if ($hour == 0) { + $hour = 12; + $meridian = 'am'; + } else if ($hour == 12) { + $meridian = 'pm'; + } else if ($hour < 12) { + $meridian = 'am'; } else { - $h1 = 0; - $h2 = 11; + $hour -= 12; + $meridian = 'pm'; } - for($h=$h1;$h<=12;$h++) { - $ht = sprintf("%02d",$h); - for($m=0;$m<60;$m=$m+15) { - $mt = sprintf("%02d",$m); - $t = $h*60+$m; - if ($h < 12) { - $dates[$t] = "$ht:$mt am"; - } else { - $dates[$t] = "$ht:$mt pm"; - } - } - } - for($h=1;$h<$h2;$h++) { - $ht = sprintf("%02d",$h); - for($m=0;$m<60;$m=$m+15) { - $mt = sprintf("%02d",$m); - $t = 12*60+$h*60+$m; - $dates[$t] = "$ht:$mt pm"; - } - } - if ($event_calendar_restricted_times == 'yes') { - $m = 0; - $h = 9; - $ht = sprintf("%02d",$h); - $mt = sprintf("%02d",$m); - $t = 12*60+$h*60+$m; - $dates[$t] = "$ht:$mt pm"; + for($h=1;$h<=12;$h++) { + $hours[$h] = $h; } } else { - if ($event_calendar_restricted_times == 'yes') { - $h1 = 6; - $h2 = 21; - } else { - $h1 = 0; - $h2 = 24; - } - for($h=$h1;$h<$h2;$h++) { - $ht = sprintf("%02d",$h); - for($m=0;$m<60;$m=$m+15) { - $mt = sprintf("%02d",$m); - $t = $h*60+$m; - $dates[$t] = "$ht:$mt"; - } - } - if ($event_calendar_restricted_times == 'yes') { - $m = 0; - $h = 21; - $ht = sprintf("%02d",$h); - $mt = sprintf("%02d",$m); - $t = 12*60+$h*60+$m; - $dates[$t] = "$ht:$mt pm"; + for($h=0;$h<=23;$h++) { + $hours[$h] = $h; } -} +} -echo elgg_view('input/dropdown',array('name'=>$vars['name'],'value'=>$time,'options_values'=>$dates)); +for($m=0;$m<60;$m=$m+5) { + $mt = sprintf("%02d",$m); + $minutes[$m] = $mt; +} +echo elgg_view('input/dropdown',array('name'=>$vars['name'].'_hour','value'=>$hour,'options_values'=>$hours)); +echo " : "; +echo elgg_view('input/dropdown',array('name'=>$vars['name'].'_minute','value'=>$minute,'options_values'=>$minutes)); +if ($time_format == '12') { + echo elgg_view('input/dropdown',array('name'=>$vars['name'].'_meridian','value'=>$meridian,'options_values'=>$meridians)); +} diff --git a/views/default/js/event_calendar/event_calendar.php b/views/default/js/event_calendar/event_calendar.php index b3ca2cc7b..244846f96 100644 --- a/views/default/js/event_calendar/event_calendar.php +++ b/views/default/js/event_calendar/event_calendar.php @@ -10,6 +10,8 @@ elgg.event_calendar.init = function () { $('.event-calendar-repeating-unselected').live('click',elgg.event_calendar.handleRepeatingSelect); $('.event-calendar-repeating-selected').live('click',elgg.event_calendar.handleRepeatingUnselect); $('#event-calendar-edit').submit(elgg.event_calendar.handleEditFormSubmit); + $('#event-calendar-edit-schedule-type').click(elgg.event_calendar.handleScheduleType); + elgg.event_calendar.handleScheduleType(); var all_day_field = $('[name="all_day"][type="checkbox"]'); if (all_day_field.is(':checked')) { @@ -21,6 +23,28 @@ elgg.event_calendar.init = function () { all_day_field.change(elgg.event_calendar.handleAllDayField); } +elgg.event_calendar.handleScheduleType = function(e) { + var st = $('#event-calendar-edit-schedule-type:checked').val(); + if (st == 'poll') { + $(".event-calendar-edit-date-wrapper").hide(); + $(".event-calendar-edit-reminder-wrapper").hide(); + $(".event-calendar-edit-form-membership-block").hide(); + $(".event-calendar-edit-form-share-block").hide(); + } else { + $(".event-calendar-edit-date-wrapper").show(); + $(".event-calendar-edit-reminder-wrapper").show(); + $(".event-calendar-edit-form-membership-block").show(); + $(".event-calendar-edit-form-share-block").show(); + if (st == 'all_day') { + $("[name='start_time']").hide(); + $("#event-calendar-to-time-wrapper").hide(); + } else { + $("[name='start_time']").show(); + $("#event-calendar-to-time-wrapper").show(); + } + } +} + elgg.event_calendar.handleAllDayField = function(e) { var field = $('[name="start_time"]'); if (field.attr('disabled') == 'disabled') { -- cgit v1.2.3 From 321fbfdb059e39b921e13ba034855b019981fa44 Mon Sep 17 00:00:00 2001 From: Kevin Jardine Date: Tue, 29 May 2012 18:09:16 +0200 Subject: added click on calendar to preselect new event date --- models/model.php | 17 ++++++---- start.php | 2 +- views/default/event_calendar/css.php | 4 +++ .../default/event_calendar/full_calendar_view.php | 39 ++++++++++++++++++++++ 4 files changed, 55 insertions(+), 7 deletions(-) (limited to 'views/default/event_calendar/css.php') diff --git a/models/model.php b/models/model.php index b53471a44..d25c8dca3 100644 --- a/models/model.php +++ b/models/model.php @@ -1533,7 +1533,7 @@ function event_calendar_get_page_content_list($page_type,$container_guid,$start_ return elgg_view_page($title,$body); } -function event_calendar_get_page_content_edit($page_type,$guid) { +function event_calendar_get_page_content_edit($page_type,$guid,$start_date='') { elgg_load_js('elgg.event_calendar'); $vars = array(); $vars['id'] = 'event-calendar-edit'; @@ -1575,7 +1575,7 @@ function event_calendar_get_page_content_edit($page_type,$guid) { $body_vars['group_guid'] = $guid; elgg_push_breadcrumb(elgg_echo('event_calendar:group_breadcrumb'), 'event_calendar/group/'.$guid); elgg_push_breadcrumb(elgg_echo('event_calendar:add_event_title')); - $body_vars['form_data'] = event_calendar_prepare_edit_form_vars(NULL,$page_type); + $body_vars['form_data'] = event_calendar_prepare_edit_form_vars(NULL,$page_type,$start_date); $content = elgg_view_form('event_calendar/edit', $vars, $body_vars); } else { $content = elgg_echo('event_calendar:no_group'); @@ -1585,7 +1585,7 @@ function event_calendar_get_page_content_edit($page_type,$guid) { elgg_push_breadcrumb(elgg_echo('event_calendar:show_events_title'),'event_calendar/list'); elgg_push_breadcrumb(elgg_echo('event_calendar:add_event_title')); - $body_vars['form_data'] = event_calendar_prepare_edit_form_vars(NULL,$page_type); + $body_vars['form_data'] = event_calendar_prepare_edit_form_vars(NULL,$page_type,$start_date); $content = elgg_view_form('event_calendar/edit', $vars, $body_vars); } @@ -1604,20 +1604,25 @@ function event_calendar_get_page_content_edit($page_type,$guid) { * @param ElggObject $event * @return array */ -function event_calendar_prepare_edit_form_vars($event = NULL, $page_type = '') { +function event_calendar_prepare_edit_form_vars($event = NULL, $page_type = '', $start_date = '') { // input names => defaults $now = time(); $iso_date = date('Y-m-d',$now); $now_midnight = strtotime($iso_date); + if ($start_date) { + $start_date = strtotime($start_date); + } else { + $start_date = $now+60*60; + } $start_time = floor(($now-$now_midnight)/60) + 60; $start_time = floor($start_time/5)*5; $values = array( 'title' => NULL, 'description' => NULL, 'venue' => NULL, - 'start_date' => $now+60*60, - 'end_date' => $now+2*60*60, + 'start_date' => $start_date, + 'end_date' => $start_date+60*60, 'start_time' => $start_time, 'end_time' => $start_time + 60, 'spots' => NULL, diff --git a/start.php b/start.php index 9d3d45e4d..8c8bba19b 100644 --- a/start.php +++ b/start.php @@ -202,7 +202,7 @@ function event_calendar_page_handler($page) { gatekeeper(); $group_guid = 0; } - echo event_calendar_get_page_content_edit($page_type,$group_guid); + echo event_calendar_get_page_content_edit($page_type,$group_guid,$page[2]); break; case 'edit': gatekeeper(); diff --git a/views/default/event_calendar/css.php b/views/default/event_calendar/css.php index 9461a7fe9..b1e17e4df 100644 --- a/views/default/event_calendar/css.php +++ b/views/default/event_calendar/css.php @@ -275,3 +275,7 @@ li.event-calendar-filter-menu-show-only { clear: both; margin-bottom: 5px; } + +.event-calendar-date-selected { + background-color: #DDDDFF; +} diff --git a/views/default/event_calendar/full_calendar_view.php b/views/default/event_calendar/full_calendar_view.php index d7b6d97a2..d86a3ac27 100644 --- a/views/default/event_calendar/full_calendar_view.php +++ b/views/default/event_calendar/full_calendar_view.php @@ -15,6 +15,28 @@ handleEventClick = function(event) { } }; +handleDayClick = function(date,allDay,jsEvent,view) { + var iso = getISODate(date); + var link = $('.elgg-menu-item-event-calendar-0add').find('a').attr('href'); + var ss = link.split('/'); + var link = $('.elgg-menu-item-event-calendar-0add').find('a').attr('href'); + var ss = link.split('/'); + var last_ss = ss[ss.length-1]; + var group_guid; + if (last_ss == 'add') { + group_guid = 0; + } else if (last_ss.split('-').length == 3) { + group_guid = ss[ss.length-2]; + } else { + group_guid = last_ss; + } + var url = elgg.get_site_url(); + $('.elgg-menu-item-event-calendar-0add').find('a').attr('href',url+'event_calendar/add/'+group_guid+'/'+iso); + $('.elgg-menu-item-event-calendar-1schedule').find('a').attr('href',url+'event_calendar/schedule/'+group_guid+'/'+iso); + $('.fc-widget-content').removeClass('event-calendar-date-selected'); + $(this).addClass('event-calendar-date-selected'); +} + handleEventDrop = function(event,dayDelta,minuteDelta,allDay,revertFunc) { if (!confirm("")) { @@ -54,6 +76,22 @@ handleGetEvents = function(start, end, callback) { callback(events); } }); + // reset date links and classes + $('.fc-widget-content').removeClass('event-calendar-date-selected'); + var link = $('.elgg-menu-item-event-calendar-0add').find('a').attr('href'); + var ss = link.split('/'); + var last_ss = ss[ss.length-1]; + var group_guid; + if (last_ss == 'add') { + group_guid = 0; + } else if (last_ss.split('-').length == 3) { + group_guid = ss[ss.length-2]; + } else { + group_guid = last_ss; + } + var url = elgg.get_site_url(); + $('.elgg-menu-item-event-calendar-0add').find('a').attr('href',url+'event_calendar/add/'+group_guid); + $('.elgg-menu-item-event-calendar-1schedule').find('a').attr('href',url+'event_calendar/schedule/'+group_guid); } $(document).ready(function() { @@ -69,6 +107,7 @@ $(document).ready(function() { slotMinutes: 15, eventDrop: handleEventDrop, eventClick: handleEventClick, + dayClick: handleDayClick, events: handleGetEvents }); }); -- cgit v1.2.3 From 2d605dc207541121f02fda9893509acb8e605212 Mon Sep 17 00:00:00 2001 From: Kevin Jardine Date: Wed, 27 Jun 2012 11:05:16 +0200 Subject: changed CSS to avoid form flash of irrelevant content for event polls, and deleted some commented out code --- actions/event_calendar/modify_full_calendar.php | 2 +- views/default/event_calendar/css.php | 6 ++ views/default/forms/event_calendar/edit.php | 86 ------------------------- 3 files changed, 7 insertions(+), 87 deletions(-) (limited to 'views/default/event_calendar/css.php') diff --git a/actions/event_calendar/modify_full_calendar.php b/actions/event_calendar/modify_full_calendar.php index 9288eb0e0..1e0bd3a01 100644 --- a/actions/event_calendar/modify_full_calendar.php +++ b/actions/event_calendar/modify_full_calendar.php @@ -10,7 +10,7 @@ $iso_date = get_input('iso_date'); $result = event_calendar_modify_full_calendar($event_guid,$day_delta,$minute_delta,$start_time,$resend,$minutes,$iso_date); if ($result) { $response = array('success'=>TRUE); - // specially handling for event polls + // special handling for event polls if (is_array($result)) { $response['minutes'] = $result['minutes']; $response['iso_date'] = $result['iso_date']; diff --git a/views/default/event_calendar/css.php b/views/default/event_calendar/css.php index b1e17e4df..c1dbf4633 100644 --- a/views/default/event_calendar/css.php +++ b/views/default/event_calendar/css.php @@ -261,10 +261,16 @@ li.event-calendar-filter-menu-show-only { .event-calendar-edit-date-wrapper { clear: both; margin-left: 20px; + display: none; } .event-calendar-edit-reminder-wrapper { margin-top: 10px; + display: none; +} + +.event-calendar-edit-form-membership-block, .event-calendar-edit-form-share-block { + display: none; } .event-calendar-description { diff --git a/views/default/forms/event_calendar/edit.php b/views/default/forms/event_calendar/edit.php index 6ea06a6b4..2ba744fc4 100644 --- a/views/default/forms/event_calendar/edit.php +++ b/views/default/forms/event_calendar/edit.php @@ -17,7 +17,6 @@ $event_calendar_repeating_events = elgg_get_plugin_setting('repeating_events', ' $event_calendar_region_display = elgg_get_plugin_setting('region_display', 'event_calendar'); $event_calendar_type_display = elgg_get_plugin_setting('type_display', 'event_calendar'); $event_calendar_spots_display = elgg_get_plugin_setting('spots_display', 'event_calendar'); -//$event_calendar_add_users = elgg_get_plugin_setting('add_users', 'event_calendar'); $event_calendar_more_required = elgg_get_plugin_setting('more_required', 'event_calendar'); $event_calendar_bbb_server_url = elgg_get_plugin_setting('bbb_server_url', 'event_calendar'); @@ -71,14 +70,6 @@ $all_day = $fd['all_day']; $schedule_type = $fd['schedule_type']; $long_description = $fd['long_description']; -/*if ($event_calendar_times != 'no') { - $start_time = $fd['start_time']; - $end_time = $fd['end_time']; -} -if ($event_calendar_personal_manage == 'by_event') { - $personal_manage = $fd['personal_manage']; -}*/ - $body = '
'; $body .= elgg_view('input/hidden',array('name'=>'event_action', 'value'=>$event_action)); @@ -134,43 +125,6 @@ $body .= elgg_view('input/radio',array('id'=>'event-calendar-edit-schedule-type' $vars['prefix'] = $prefix; -/* -$body .= '
'; -$body .= elgg_view('event_calendar/datetime_edit', - array( - 'start_date' => $start_date, - 'end_date' => $end_date, - 'start_time' => $start_time, - 'end_time' => $end_time, - 'prefix' => $prefix, -)); -if ($event_calendar_repeated_events == 'yes') { - $body .= elgg_view('event_calendar/repeat_form_element',$vars); -} -if ($event_calendar_reminders == 'yes') { - $body .= '
'; - if ($send_reminder) { - $body .= elgg_view('input/checkbox',array('name'=>'send_reminder','checked' => 'checked','value'=>1)); - } else { - $body .= elgg_view('input/checkbox',array('name'=>'send_reminder','value'=>1)); - } - $body .= elgg_echo('elgg_calendar:send_reminder_label'). ' '; - $numbers = array(); - for ($i=1;$i<60;$i++) { - $numbers[$i] = $i; - } - $intervals = array( - 1 => elgg_echo('event_calendar:interval:minute'), - 60 => elgg_echo('event_calendar:interval:hour'), - 60*24 => elgg_echo('event_calendar:interval:day'), - ); - - $body .= elgg_view('input/dropdown',array('name'=>'reminder_number','options_values'=>$numbers,'value'=>$reminder_number)); - $body .= elgg_view('input/dropdown',array('name'=>'reminder_interval','options_values'=>$intervals,'value'=>$reminder_interval)); - $body .= elgg_echo('elgg_calendar:send_reminder_before'); - $body .= '
'; -}*/ - $body .= elgg_view('event_calendar/schedule_section',$vars); if ($event_calendar_spots_display == 'yes') { @@ -183,50 +137,10 @@ if ($event_calendar_spots_display == 'yes') { $body .= '
'; $body .= '
'; -// the following feature has been superceded by the manage subscribers feature - -/*if ($event_calendar_add_users == 'yes') { - $body .= '



'; - $body .= '

'.elgg_echo('event_calendar:add_user_description').'

'; -}*/ - $body .= elgg_view('event_calendar/personal_manage_section',$vars); -/*if ($event_calendar_personal_manage == 'by_event') { - $body .= '
'; - $body .= '

'.elgg_echo('event_calendar:personal_manage:label').'

'; - $body .= elgg_view("input/radio",array('name' => 'personal_manage','value'=>$personal_manage,'options'=>$personal_manage_options)); - //$body .= '

'.$prefix['personal_manage'].elgg_echo('event_calendar:personal_manage:description').'

'; - $body .= '
'; - $body .= '
'; -}*/ - $body .= elgg_view('event_calendar/share_section',$vars); -/*$body .= '';*/ - if ($event_calendar_region_display == 'yes' || $event_calendar_type_display == 'yes' || $event_calendar_fewer_fields != 'yes') { $body .= '
'; -- cgit v1.2.3