From 0b25adcd921149b50845647980284e8ab66d8fed Mon Sep 17 00:00:00 2001
From: Kevin Jardine
'; + $body .= elgg_view("event_calendar/input/date_local",array( + 'timestamp'=>TRUE, + 'autocomplete'=>'off', + 'class'=>'event-calendar-compressed-date', + 'name' => 'end_date', + 'value'=>$vars['end_date'], + )); + $body .= elgg_view("input/timepicker",array('name' => 'end_time','value'=>$vars['end_time'])); + } + $body .= '
'; +} else { + + $body .= ''; + $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').'
'; + } +} + +echo $body; \ No newline at end of file diff --git a/views/default/event_calendar/full_calendar_view.php b/views/default/event_calendar/full_calendar_view.php index 58aefe741..2c97eb159 100644 --- a/views/default/event_calendar/full_calendar_view.php +++ b/views/default/event_calendar/full_calendar_view.php @@ -1,31 +1,6 @@ $e->guid, - //'title' => ''.$e->title.'', - 'title' => $e->title, - 'url' => $e->getURL(), - 'start_date' => $e->start_date, - 'end_date' => $e->real_end_time, - ); - if ($times_supported) { - $event_item['allDay'] = FALSE; - } else { - $event_item['allDay'] = TRUE; - } - - $event_array[] = $event_item; -} - -$json_events_string = json_encode($event_array); - // TODO: is there an easy way to avoid embedding JS? ?> diff --git a/views/default/event_calendar/repeat_form_element.php b/views/default/event_calendar/repeat_form_element.php new file mode 100644 index 000000000..45fdabfa1 --- /dev/null +++ b/views/default/event_calendar/repeat_form_element.php @@ -0,0 +1,43 @@ +'repeats','value'=>'yes','checked'=>'checked')); +} else { + echo elgg_view('input/checkbox',array('name'=>'repeats','value'=>'yes')); +} +echo elgg_echo('event_calendar:repeat_interval_label').' '; +echo elgg_view('input/dropdown',array('name'=>'repeat_interval','value'=>$fd['repeat_interval'],'options_values'=>array('1'=>'1','2'=>'2','3'=>'3','4'=>'4','5'=>'5','6'=>'6','7'=>'7','8'=>'8'))); +echo ' '.elgg_echo('event_calendar:repeat_weeks'); +echo ' '.elgg_echo('event_calendar:on_these_days'); +?> + + + + + + + + diff --git a/views/default/event_calendar/show_events.php b/views/default/event_calendar/show_events.php index 63d722247..3a484e756 100644 --- a/views/default/event_calendar/show_events.php +++ b/views/default/event_calendar/show_events.php @@ -10,16 +10,21 @@ * */ +elgg_load_library('elgg:event_calendar'); + $listing_format = $vars['listing_format']; if ($vars['events']) { if ($listing_format == 'agenda') { + $vars['events'] = event_calendar_flatten_event_structure($vars['events']); $event_list = elgg_view('event_calendar/agenda_view',$vars); } else if ($listing_format == 'paged') { + $vars['events'] = event_calendar_flatten_event_structure($vars['events']); $event_list = elgg_view('event_calendar/paged_view',$vars); } else if ($listing_format == 'full') { $event_list = elgg_view('event_calendar/full_calendar_view',$vars); } else { + $vars['events'] = event_calendar_flatten_event_structure($vars['events']); $options = array( 'list_class' => 'elgg-list-entity', 'full_view' => FALSE, @@ -32,7 +37,12 @@ if ($vars['events']) { $event_list = elgg_view_entity_list($vars['events'], $options); } } else { - $event_list = ''.elgg_echo('event_calendar:no_events_found').'
'; + if ($listing_format == 'full') { + // show the empty calendar + $event_list = elgg_view('event_calendar/full_calendar_view',$vars); + } else { + $event_list = ''.elgg_echo('event_calendar:no_events_found').'
'; + } } if ($listing_format == 'paged' || $listing_format == 'full') { echo $event_list; diff --git a/views/default/forms/event_calendar/edit.php b/views/default/forms/event_calendar/edit.php index 3526627a7..713fb9abc 100644 --- a/views/default/forms/event_calendar/edit.php +++ b/views/default/forms/event_calendar/edit.php @@ -3,20 +3,29 @@ $event = $vars['event']; $fd = $vars['form_data']; $personal_manage_options = array( - elgg_echo('event_calendar:personal_manage:open') => 'open', - elgg_echo('event_calendar:personal_manage:closed') => 'closed', - elgg_echo('event_calendar:personal_manage:private') => 'private', + 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', ); -$event_calendar_times = elgg_get_plugin_setting('times', 'event_calendar'); +$schedule_options = array( + elgg_echo('event_calendar:schedule_type:poll')=>'poll', + elgg_echo('event_calendar:schedule_type:fixed')=>'fixed', +); + +$event_calendar_fewer_fields = elgg_get_plugin_setting('fewer_fields', 'event_calendar'); +$event_calendar_repeating_events = elgg_get_plugin_setting('repeating_events', 'event_calendar'); + $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_hide_access = elgg_get_plugin_setting('hide_access', 'event_calendar'); -$event_calendar_hide_end = elgg_get_plugin_setting('hide_end', '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'); if ($event_calendar_more_required == 'yes') { $required_fields = array('title','venue','start_date','start_time', @@ -39,7 +48,7 @@ foreach ($all_fields as $fn) { } if ($event) { - $title = $event->title; + /*$title = $event->title; $brief_description = $event->description; $venue = $event->venue; // this is a form redisplay, so take the values as submitted @@ -65,7 +74,15 @@ if ($event) { $fees = $event->fees; $contact = $event->contact; $organiser = $event->organiser; - $event_tags = $event->event_tags; + 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') { @@ -77,91 +94,144 @@ if ($event) { if (!$personal_manage) { $personal_manage = 'open'; } - } + }*/ $event_action = 'manage_event'; $event_guid = $event->guid; -} else { - $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']; - } - if ($event_calendar_region_display) { - $region = $fd['region']; - } - if ($event_calendar_type_display) { - $event_type = $fd['event_type']; - } - $contact = $fd['contact']; - $organiser = $fd['organiser']; - $event_tags = $fd['event_tags']; - $long_description = $fd['long_description']; - $access = $fd['access_id']; - 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']; - } +} else { $event_action = 'add_event'; $event_guid = 0; } -$body = ''; + +$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']; +} +if ($event_calendar_region_display) { + $region = $fd['region']; +} +if ($event_calendar_type_display) { + $event_type = $fd['event_type']; +} +$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') { + $start_time = $fd['start_time']; + $end_time = $fd['end_time']; +} +if ($event_calendar_personal_manage == 'by_event') { + $personal_manage = $fd['personal_manage']; +} + +$body = ''.$prefix['title'].elgg_echo('event_calendar:title_description').'
'; +$body .= ''.$prefix['venue'].elgg_echo('event_calendar:venue_description').'
'; +$body .= ''; +$body .= elgg_view("input/text",array('name' => 'title','class'=>'event-calendar-medium-text','value'=>$title)); +$body .= '
'; +$body .= ''.$prefix['title'].elgg_echo('event_calendar:title_description').'
'; -if ($event_calendar_times != 'no') { - $body .= ''; - } - $body .= elgg_view("event_calendar/input/date_local",array('timestamp'=>TRUE, 'autocomplete'=>'off','class'=>'event-calendar-compressed-date','name' => 'start_date','value'=>$start_date)); - $body .= elgg_view("input/timepicker",array('name' => 'start_time','value'=>$start_time)); - if ($event_calendar_hide_end != 'yes') { - $body .= '
'; - $body .= elgg_view("event_calendar/input/date_local",array('timestamp'=>TRUE,'autocomplete'=>'off','class'=>'event-calendar-compressed-date','name' => 'end_date','value'=>$end_date)); - $body .= elgg_view("input/timepicker",array('name' => 'end_time','value'=>$end_time)); - } +$body .= '
'; +$body .= elgg_view("input/text",array('name' => 'venue','class'=>'event-calendar-medium-text','value'=>$venue)); +$body .= '
'; +$body .= ''.$prefix['venue'].elgg_echo('event_calendar:venue_description').'
'; + +$body .= ''; +$body .= elgg_view("input/text",array('name' => 'description','class'=>'event-calendar-medium-text','value'=>$brief_description)); +$body .= '
'; +$body .= ''.$prefix['brief_description'].elgg_echo('event_calendar:brief_description_description').'
'; + +$body .= ''; +$body .= elgg_view("input/tags",array('name' => 'tags','class'=>'event-calendar-medium-text','value'=>$event_tags)); +$body .= '
'; +$body .= ''.$prefix['event_tags'].elgg_echo('event_calendar:event_tags_description').'
'; + +$body .= ''; +$body .= elgg_view('event_calendar/container',array('container_guid'=>$vars['container_guid'])); +$body .= '
'; +$body .= ''.$prefix['calendar'].elgg_echo('event_calendar:calendar_description').'
'; + +if(elgg_plugin_exists('sched_conf')) { + $body .= ''; + $body .= elgg_view('input/checkbox',array('name'=>'web_conference','value'=>$web_conference,'options_values'=>array('1'))); + $body .= elgg_echo('event_calendar:web_conference_label'); $body .= '
'; - $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['spots'].elgg_echo('event_calendar:spots_description').'
'; + $body .= ''.$prefix['spots'].elgg_echo('event_calendar:spots_description').'
'; } +$body .= ''.elgg_echo('event_calendar:add_user_description').'
'; }*/ -$body .= ''; -$body .= ''.$prefix['brief_description'].elgg_echo('event_calendar:brief_description_description').'
'; - -if ($event_calendar_region_display == 'yes') { - $region_list = trim(elgg_get_plugin_setting('region_list', 'event_calendar')); - $region_list_handles = elgg_get_plugin_setting('region_list_handles', 'event_calendar'); - // make sure that we are using Unix line endings - $region_list = str_replace("\r\n","\n",$region_list); - $region_list = str_replace("\r","\n",$region_list); - if ($region_list) { - $options = array(); - $options[] = '-'; - foreach(explode("\n",$region_list) as $region_item) { - $region_item = trim($region_item); - if ($region_list_handles == 'yes') { - $options[$region_item] = elgg_echo('event_calendar:region:'.$region_item); - } else { - $options[$region_item] = $region_item; - } - } - $body .= ''; - $body .= ''.$prefix['region'].elgg_echo('event_calendar:region_description').'
'; - } -} - -if ($event_calendar_type_display == 'yes') { - $type_list = trim(elgg_get_plugin_setting('type_list', 'event_calendar')); - $type_list_handles = elgg_get_plugin_setting('type_list_handles', 'event_calendar'); - // make sure that we are using Unix line endings - $type_list = str_replace("\r\n","\n",$type_list); - $type_list = str_replace("\r","\n",$type_list); - if ($type_list) { - $options = array(); - $options[] = '-'; - foreach(explode("\n",$type_list) as $type_item) { - $type_item = trim($type_item); - if ($type_list_handles == 'yes') { - $options[$type_item] = elgg_echo('event_calendar:type:'.$type_item); - } else { - $options[$type_item] = $type_item; - } - } - $body .= ''; - $body .= ''.$prefix['event_type'].elgg_echo('event_calendar:type_description').'
'; - } -} - -$body .= ''; -$body .= ''.$prefix['fees'].elgg_echo('event_calendar:fees_description').'
'; - -$body .= ''; -$body .= ''.$prefix['contact'].elgg_echo('event_calendar:contact_description').'
'; - -$body .= ''; -$body .= ''.$prefix['organiser'].elgg_echo('event_calendar:organiser_description').'
'; - if ($event_calendar_personal_manage == 'by_event') { - $body .= '