Ejemplo n.º 1
0
    return;
}
elgg_require_js('event_manager/view_event');
$tabtitles = '';
$tabcontent = '';
if ($eventDays = $event->getEventDays()) {
    foreach ($eventDays as $key => $day) {
        if ($key == 0) {
            // select the first
            $selected = true;
            $tabtitles .= "<li class='elgg-state-selected'>";
        } else {
            $selected = false;
            $tabtitles .= "<li>";
        }
        $day_title = event_manager_format_date($day->date);
        if ($description = $day->description) {
            $day_title = $description;
        }
        $tabtitles .= "<a href='javascript:void(0);' rel='day_" . $day->getGUID() . "'>" . $day_title . "</a>";
        $tabtitles .= "</li>";
        $tabcontent .= elgg_view('event_manager/program/elements/day', ['entity' => $day, 'selected' => $selected, 'participate' => true, 'register_type' => $register_type]);
    }
}
$program = '<div id="event_manager_event_view_program">';
$program .= '<ul class="elgg-tabs elgg-htabs">';
$program .= $tabtitles;
$program .= '</ul>';
$program .= '</div>';
$program .= elgg_view('input/hidden', ['id' => 'event_manager_program_guids', 'name' => 'program_guids']);
$program .= $tabcontent;
Ejemplo n.º 2
0
<?php

$entity = elgg_extract('entity', $vars);
$size = elgg_extract('size', $vars, 'medium');
if ($size !== 'date') {
    return;
}
$event_start = $entity->getStartTimestamp();
$icon = "<div class='event_manager_event_list_icon' title='" . event_manager_format_date($event_start) . "'>";
$icon .= "<div class='event_manager_event_list_icon_month'>" . strtoupper(trim(elgg_echo('date:month:short:' . date("m", $event_start), ['']))) . "</div>";
$icon .= "<div class='event_manager_event_list_icon_day'>" . date("d", $event_start) . "</div>";
$icon .= "</div>";
echo $icon;
Ejemplo n.º 3
0
/**
 * Export the event attendees. Returns csv body
 *
 * @param ElggObject $event the event
 * @param string     $rel   relationship type
 *
 * @return string
 */
function event_manager_export_attendees($event, $rel = EVENT_MANAGER_RELATION_ATTENDING)
{
    $old_ia = elgg_set_ignore_access(true);
    $headerString = '';
    $dataString = '';
    $headerString .= '"guid";"' . elgg_echo('name') . '";"' . elgg_echo('email') . '";"' . elgg_echo('username') . '";"registration date"';
    if ($event->registration_needed) {
        if ($registration_form = $event->getRegistrationFormQuestions()) {
            foreach ($registration_form as $question) {
                $headerString .= ';"' . $question->title . '"';
            }
        }
    }
    if ($event->with_program) {
        if ($eventDays = $event->getEventDays()) {
            foreach ($eventDays as $eventDay) {
                $date = event_manager_format_date($eventDay->date);
                if ($eventSlots = $eventDay->getEventSlots()) {
                    foreach ($eventSlots as $eventSlot) {
                        $start_time = $eventSlot->start_time;
                        $end_time = $eventSlot->end_time;
                        $start_time_hour = date('H', $start_time);
                        $start_time_minutes = date('i', $start_time);
                        $end_time_hour = date('H', $end_time);
                        $end_time_minutes = date('i', $end_time);
                        $headerString .= ';"Event activity: \'' . addslashes($eventSlot->title) . '\' ' . $date . ' (' . $start_time_hour . ':' . $start_time_minutes . ' - ' . $end_time_hour . ':' . $end_time_minutes . ')"';
                    }
                }
            }
        }
    }
    $attendees = new ElggBatch('elgg_get_entities_from_relationship', ['relationship' => $rel, 'relationship_guid' => $event->getGUID(), 'inverse_relationship' => false, 'site_guids' => false, 'limit' => false]);
    foreach ($attendees as $attendee) {
        $answerString = '';
        $dataString .= '"' . $attendee->guid . '";"' . $attendee->name . '";"' . $attendee->email . '";"' . $attendee->username . '"';
        $relation = check_entity_relationship($event->guid, $rel, $attendee->guid);
        $dataString .= ';"' . date("d-m-Y H:i:s", $relation->time_created) . '"';
        if ($event->registration_needed) {
            if ($registration_form = $event->getRegistrationFormQuestions()) {
                foreach ($registration_form as $question) {
                    $answer = $question->getAnswerFromUser($attendee->getGUID());
                    $answerString .= '"' . addslashes($answer->value) . '";';
                }
            }
            $dataString .= ';' . substr($answerString, 0, strlen($answerString) - 1);
        }
        if ($event->with_program) {
            if ($eventDays = $event->getEventDays()) {
                foreach ($eventDays as $eventDay) {
                    if ($eventSlots = $eventDay->getEventSlots()) {
                        foreach ($eventSlots as $eventSlot) {
                            if (check_entity_relationship($attendee->getGUID(), EVENT_MANAGER_RELATION_SLOT_REGISTRATION, $eventSlot->getGUID())) {
                                $dataString .= ';"V"';
                            } else {
                                $dataString .= ';""';
                            }
                        }
                    }
                }
            }
        }
        $dataString .= PHP_EOL;
    }
    elgg_set_ignore_access($old_ia);
    return $headerString . PHP_EOL . $dataString;
}
Ejemplo n.º 4
0
<?php

$day = elgg_extract('entity', $vars);
$participate = elgg_extract('participate', $vars);
$register_type = elgg_extract('register_type', $vars);
$details_only = elgg_extract('details_only', $vars);
if (!$day instanceof \ColdTrick\EventManager\Event\Day) {
    return;
}
$can_edit = $day->canEdit();
$details = '';
if ($description = $day->description) {
    $details .= '<div><b>' . elgg_echo('event_manager:edit:form:start_day') . ':</b> ' . event_manager_format_date($day->date) . '</div>';
}
$details .= $day->title;
if ($can_edit && !elgg_in_context('programmailview') && $participate == false) {
    elgg_load_js('lightbox');
    elgg_load_css('lightbox');
    $edit_day = elgg_view('output/url', ['href' => 'javascript:void(0);', 'rel' => $day->getGUID(), 'data-colorbox-opts' => json_encode(['href' => elgg_normalize_url('ajax/view/event_manager/forms/program/day?day_guid=' . $day->getGUID())]), 'class' => 'event_manager_program_day_edit elgg-lightbox', 'text' => elgg_echo('edit')]);
    $delete_day = elgg_view('output/url', ['href' => 'javascript:void(0);', 'class' => 'event_manager_program_day_delete', 'text' => elgg_echo('delete')]);
    $details .= " [ {$edit_day} | {$delete_day} ]";
}
if ($details_only) {
    echo $details;
    return;
}
$day_info = elgg_format_element('div', ['class' => 'event_manager_program_day_details pbs mbs elgg-divide-bottom', 'rel' => $day->getGUID()], $details);
$slots = '';
$daySlots = $day->getEventSlots();
if ($daySlots) {
    $member = elgg_extract('member', $vars);
Ejemplo n.º 5
0
<?php

if (elgg_extract('full_view', $vars)) {
    echo elgg_view("event_manager/event/view", $vars);
    return;
}
$event = elgg_extract('entity', $vars);
if (elgg_in_context('maps')) {
    $output = '<div class="gmaps_infowindow">';
    $output .= '<div class="gmaps_infowindow_text">';
    $output .= '<div class="event_manager_event_view_owner"><a href="' . $event->getURL() . '">' . $event->title . '</a> (' . event_manager_format_date($event->getStartTimestamp()) . ')</div>';
    $output .= str_replace(',', '<br />', $event->location) . '<br /><br />' . $event->shortdescription . '<br /><br />';
    $output .= elgg_view("event_manager/event/actions", $vars) . '</div>';
    if ($event->icontime) {
        $output .= '<div class="gmaps_infowindow_icon"><img src="' . $event->getIconURL() . '" /></div>';
    }
    $output .= '</div>';
    echo $output;
    return;
}
$content = '';
$subtitle = '';
if (!elgg_in_context('widgets')) {
    $subtitle = elgg_view('page/elements/by_line', $vars);
    $location = $event->location;
    if ($location) {
        $content .= '<div>' . elgg_echo('event_manager:edit:form:location') . ': ';
        $content .= elgg_view('output/url', ['href' => $event->getURL() . '#location', 'text' => $location]);
        $content .= '</div>';
    }
    $shortdescription = $event->shortdescription;
Ejemplo n.º 6
0
    }
    $files_title .= elgg_echo('event_manager:edit:form:files');
    if (empty($event_files)) {
        $event_files = elgg_echo('event_manager:event:uploadfiles:no_files');
    }
    $event_details .= elgg_view_module('info', $files_title, $event_files);
}
$registration_details = '';
$max_attendees = $event->max_attendees;
$fee = $event->fee;
$type = $event->event_type;
$endregistration_day = $event->endregistration_day;
if ($endregistration_day) {
    $registration_details .= '<div class="clearfix">';
    $registration_details .= '<label class="elgg-col elgg-col-1of5">' . elgg_echo('event_manager:edit:form:endregistration_day') . ':</label>';
    $registration_details .= '<span class="elgg-col elgg-col-4of5">' . event_manager_format_date($endregistration_day) . '</span>';
    $registration_details .= '</div>';
}
if ($max_attendees) {
    $registration_details .= '<div class="clearfix">';
    $registration_details .= '<label class="elgg-col elgg-col-1of5">' . elgg_echo('event_manager:edit:form:spots_left') . ':</label>';
    $registration_details .= '<span class="elgg-col elgg-col-4of5">';
    $spots_left = $max_attendees - $event->countAttendees();
    if ($spots_left < 1) {
        $count_waitinglist = $event->countWaiters();
        if ($count_waitinglist > 0) {
            $registration_details .= elgg_echo('event_manager:full') . ', ' . $count_waitinglist . ' ';
            if ($count_waitinglist == 1) {
                $registration_details .= elgg_echo('event_manager:personwaitinglist');
            } else {
                $registration_details .= elgg_echo('event_manager:peoplewaitinglist');