primo commit

This commit is contained in:
2024-12-17 17:34:10 +01:00
commit e650f8df99
16435 changed files with 2451012 additions and 0 deletions

View File

@ -0,0 +1 @@
<!DOCTYPE html><title></title>

View File

@ -0,0 +1,411 @@
<?php
/**
* @version 2.3.1
* @package JEM
* @copyright (C) 2013-2021 joomlaeventmanager.net
* @copyright (C) 2005-2009 Christoph Lukes
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
*/
defined('_JEXEC') or die;
?>
<div id="jem" class="jlcalendar jem_calendar<?php echo $this->pageclass_sfx;?>">
<div class="buttons">
<?php
$btn_params = array('print_link' => $this->print_link);
echo JemOutput::createButtonBar($this->getName(), $this->permissions, $btn_params);
?>
</div>
<?php if ($this->params->get('show_page_heading', 1)): ?>
<h1 class="componentheading">
<?php echo $this->escape($this->params->get('page_heading')); ?>
</h1>
<?php endif; ?>
<?php if ($this->params->get('showintrotext')) : ?>
<div class="description no_space floattext">
<?php echo $this->params->get('introtext'); ?>
</div>
<p> </p>
<?php endif; ?>
<?php
$countcatevents = array ();
$countperday = array();
$limit = $this->params->get('daylimit', 10);
$evbg_usecatcolor = $this->params->get('eventbg_usecatcolor', 0);
$showtime = $this->settings->get('global_show_timedetails', 1);
foreach ($this->rows as $row) :
if (!JemHelper::isValidDate($row->dates)) {
continue; // skip, open date !
}
//get event date
$year = strftime('%Y', strtotime($row->dates));
$month = strftime('%m', strtotime($row->dates));
$day = strftime('%d', strtotime($row->dates));
@$countperday[$year.$month.$day]++;
if ($countperday[$year.$month.$day] == $limit+1) {
$var1a = JRoute::_('index.php?option=com_jem&view=day&id='.$year.$month.$day . $this->param_topcat);
$var1b = JText::_('COM_JEM_AND_MORE');
$var1c = "<a href=\"".$var1a."\">".$var1b."</a>";
$id = 'eventandmore';
$this->cal->setEventContent($year, $month, $day, $var1c, null, $id);
continue;
} elseif ($countperday[$year.$month.$day] > $limit+1) {
continue;
}
//for time in tooltip
$timehtml = '';
if ($showtime) {
$start = JemOutput::formattime($row->times);
$end = JemOutput::formattime($row->endtimes);
if ($start != '') {
$timehtml = '<div class="time"><span class="text-label">'.JText::_('COM_JEM_TIME_SHORT').': </span>';
$timehtml .= $start;
if ($end != '') {
$timehtml .= ' - '.$end;
}
$timehtml .= '</div>';
}
}
$eventname = '<div class="eventName">'.JText::_('COM_JEM_TITLE_SHORT').': '.$this->escape($row->title).'</div>';
$detaillink = JRoute::_(JemHelperRoute::getEventRoute($row->slug));
//initialize variables
$multicatname = '';
$colorpic = '';
$nr = is_array($row->categories) ? count($row->categories) : 0;
$ix = 0;
$content = '';
$contentend = '';
$catcolor = array();
//walk through categories assigned to an event
foreach((array)$row->categories AS $category) {
//Currently only one id possible...so simply just pick one up...
$detaillink = JRoute::_(JemHelperRoute::getEventRoute($row->slug));
//wrap a div for each category around the event for show hide toggler
$content .= '<div id="catz" class="cat'.$category->id.'">';
$contentend .= '</div>';
//attach category color if any in front of the catname
if ($category->color) {
$multicatname .= '<span class="colorpic" style="width:6px; background-color: '.$category->color.';"></span>&nbsp;'.$category->catname;
} else {
$multicatname .= $category->catname;
}
$ix++;
if ($ix != $nr) {
$multicatname .= ', ';
}
//attach category color if any in front of the event title in the calendar overview
if (isset($category->color) && $category->color) {
$colorpic .= '<span class="colorpic" style="width:6px; background-color: '.$category->color.';"></span>';
$catcolor[$category->color] = $category->color; // we need to list all different colors of this event
}
//count occurence of the category
if (!isset($row->multi) || ($row->multi == 'first')) {
if (!array_key_exists($category->id, $countcatevents)) {
$countcatevents[$category->id] = 1;
} else {
$countcatevents[$category->id]++;
}
}
}
$color = '<div id="eventcontenttop" class="eventcontenttop">';
$color .= $colorpic;
$color .= '</div>';
// multiday
$multi_mode = 0; // single day
$multi_icon = '';
if (isset($row->multi)) {
switch ($row->multi) {
case 'first': // first day
$multi_mode = 1;
$multi_icon = JHtml::_("image","com_jem/arrow-left.png",'', NULL, true);
break;
case 'middle': // middle day
$multi_mode = 2;
$multi_icon = JHtml::_("image","com_jem/arrow-middle.png",'', NULL, true);
break;
case 'zlast': // last day
$multi_mode = 3;
$multi_icon = JHtml::_("image","com_jem/arrow-right.png",'', NULL, true);
break;
}
}
//for time in calendar
$timetp = '';
if ($showtime) {
$start = JemOutput::formattime($row->times,'',false);
$end = JemOutput::formattime($row->endtimes,'',false);
switch ($multi_mode) {
case 1:
$timetp .= $multi_icon . ' ' . $start . '<br />';
break;
case 2:
$timetp .= $multi_icon . '<br />';
break;
case 3:
$timetp .= $multi_icon . ' ' . $end . '<br />';
break;
default:
if ($start != '') {
$timetp .= $start;
if ($end != '') {
$timetp .= ' - '.$end;
}
$timetp .= '<br />';
}
break;
}
} else {
if (!empty($multi_icon)) {
$timetp .= $multi_icon . ' ';
}
}
$catname = '<div class="catname">'.$multicatname.'</div>';
$eventdate = !empty($row->multistartdate) ? JemOutput::formatdate($row->multistartdate) : JemOutput::formatdate($row->dates);
if (!empty($row->multienddate)) {
$eventdate .= ' - ' . JemOutput::formatdate($row->multienddate);
} else if ($row->enddates && $row->dates < $row->enddates) {
$eventdate .= ' - ' . JemOutput::formatdate($row->enddates);
}
//venue
if ($this->jemsettings->showlocate == 1) {
$venue = '<div class="location"><span class="text-label">'.JText::_('COM_JEM_VENUE_SHORT').': </span>';
$venue .= !empty($row->venue) ? $this->escape($row->venue) : '-';
$venue .= '</div>';
} else {
$venue = '';
}
// state if unpublished
$statusicon = '';
if (isset($row->published) && ($row->published != 1)) {
$statusicon = JemOutput::publishstateicon($row);
$eventstate = '<div class="eventstate"><span class="text-label">'.JText::_('JSTATUS').': </span>';
switch ($row->published) {
case 1: $eventstate .= JText::_('JPUBLISHED'); break;
case 0: $eventstate .= JText::_('JUNPUBLISHED'); break;
case 2: $eventstate .= JText::_('JARCHIVED'); break;
case -2: $eventstate .= JText::_('JTRASHED'); break;
}
$eventstate .= '</div>';
} else {
$eventstate = '';
}
//date in tooltip
$multidaydate = '<div class="time"><span class="text-label">'.JText::_('COM_JEM_DATE').': </span>';
switch ($multi_mode) {
case 1: // first day
$multidaydate .= JemOutput::formatShortDateTime($row->dates, $row->times, $row->enddates, $row->endtimes, $showtime);
$multidaydate .= JemOutput::formatSchemaOrgDateTime($row->dates, $row->times, $row->enddates, $row->endtimes);
break;
case 2: // middle day
$multidaydate .= JemOutput::formatShortDateTime($row->multistartdate, $row->times, $row->multienddate, $row->endtimes, $showtime);
$multidaydate .= JemOutput::formatSchemaOrgDateTime($row->multistartdate, $row->times, $row->multienddate, $row->endtimes);
break;
case 3: // last day
$multidaydate .= JemOutput::formatShortDateTime($row->multistartdate, $row->times, $row->multienddate, $row->endtimes, $showtime);
$multidaydate .= JemOutput::formatSchemaOrgDateTime($row->multistartdate, $row->times, $row->multienddate, $row->endtimes);
break;
default: // single day
$multidaydate .= JemOutput::formatShortDateTime($row->dates, $row->times, $row->enddates, $row->endtimes, $showtime);
$multidaydate .= JemOutput::formatSchemaOrgDateTime($row->dates, $row->times, $row->enddates, $row->endtimes);
break;
}
$multidaydate .= '</div>';
//create little Edit and/or Copy icon on top right corner of event if user is allowed to edit and/or create
$editicon = '';
if (!$this->print) {
$btns = array();
if ($this->params->get('show_editevent_icon', 0) && $row->params->get('access-edit', false)) {
$btns[] = JemOutput::editbutton($row, null, null, true, 'editevent');
}
if ($this->params->get('show_copyevent_icon', 0) && $this->permissions->canAddEvent) {
$btns[] = JemOutput::copybutton($row, null, null, true, 'editevent');
}
if (!empty($btns)) {
$editicon .= '<div class="inline-button-right">';
$editicon .= join(' ', $btns);
$editicon .= '</div>';
}
}
//generate the output
// if we have exact one color from categories we can use this as background color of event
if (!empty($evbg_usecatcolor) && (count($catcolor) == 1)) {
$content .= '<div class="eventcontentinner" style="background-color:'.array_pop($catcolor).'">';
$content .= $editicon;
$content .= JemHelper::caltooltip($catname.$eventname.$timehtml.$venue.$eventstate, $eventdate, $row->title . $statusicon, $detaillink, 'editlinktip hasTip', $timetp, $category->color);
$content .= $contentend . '</div>';
} else {
$content .= '<div class="eventcontentinner">' . $colorpic;
$content .= $editicon;
$content .= JemHelper::caltooltip($catname.$eventname.$timehtml.$venue.$eventstate, $eventdate, $row->title . $statusicon, $detaillink, 'editlinktip hasTip', $timetp, $category->color);
$content .= $contentend . '</div>';
}
$this->cal->setEventContent($year, $month, $day, $content);
endforeach;
// enable little icon right beside day number to allow event creation
if (!$this->print && $this->params->get('show_addevent_icon', 0) && !empty($this->permissions->canAddEvent)) {
$html = JemOutput::prepareAddEventButton();
$this->cal->enableNewEventLinks($html);
}
$displayLegend = (int)$this->params->get('displayLegend', 1);
if ($displayLegend == 2) : ?>
<!-- Calendar legend above -->
<div id="jlcalendarlegend">
<!-- Calendar buttons -->
<div class="calendarButtons">
<div class="calendarButtonsToggle">
<div id="buttonshowall" class="btn btn-outline-dark">
<?php echo JText::_('COM_JEM_SHOWALL'); ?>
</div>
<div id="buttonhideall" class="btn btn-outline-dark">
<?php echo JText::_('COM_JEM_HIDEALL'); ?>
</div>
</div>
</div>
<div class="clr"></div>
<!-- Calendar Legend -->
<div class="calendarLegends">
<?php
if ($this->params->get('displayLegend')) {
##############
## FOR EACH ##
##############
$counter = array();
# walk through events
foreach ($this->rows as $row) {
foreach ($row->categories as $cat) {
# sort out dupes for the counter (catid-legend)
if (!in_array($cat->id, $counter)) {
# add cat id to cat counter
$counter[] = $cat->id;
# build legend
if (array_key_exists($cat->id, $countcatevents)) {
?>
<div class="eventCat btn btn-outline-dark" id="cat<?php echo $cat->id; ?>">
<?php
if (isset($cat->color) && $cat->color) {
echo '<span class="colorpic" style="background-color: '.$cat->color.';"></span>';
}
echo $cat->catname.' ('.$countcatevents[$cat->id].')';
?>
</div>
<?php
}
}
}
}
}
?>
</div>
</div>
<?php endif; ?>
<?php
// print the calendar
echo $this->cal->showMonth();
?>
<?php if (($displayLegend == 1) || ($displayLegend == 0)) : ?>
<!-- Calendar legend below -->
<div id="jlcalendarlegend">
<!-- Calendar buttons -->
<div class="calendarButtons">
<div class="calendarButtonsToggle">
<div id="buttonshowall" class="btn btn-outline-dark">
<?php echo JText::_('COM_JEM_SHOWALL'); ?>
</div>
<div id="buttonhideall" class="btn btn-outline-dark">
<?php echo JText::_('COM_JEM_HIDEALL'); ?>
</div>
</div>
</div>
<div class="clr"></div>
<!-- Calendar Legend -->
<div class="calendarLegends">
<?php
if ($displayLegend == 1) {
##############
## FOR EACH ##
##############
$counter = array();
# walk through events
foreach ($this->rows as $row) {
foreach ($row->categories as $cat) {
# sort out dupes for the counter (catid-legend)
if (!in_array($cat->id, $counter)) {
# add cat id to cat counter
$counter[] = $cat->id;
# build legend
if (array_key_exists($cat->id, $countcatevents)) {
?>
<div class="eventCat btn btn-outline-dark" id="cat<?php echo $cat->id; ?>">
<?php
if (isset($cat->color) && $cat->color) {
echo '<span class="colorpic" style="background-color: '.$cat->color.';"></span>';
}
echo $cat->catname.' ('.$countcatevents[$cat->id].')';
?>
</div>
<?php
}
}
}
}
}
?>
</div>
</div>
<?php endif; ?>
<div class="clr"></div>
<div class="copyright">
<?php echo JemOutput::footer(); ?>
</div>
</div>

View File

@ -0,0 +1,126 @@
<?xml version="1.0" encoding="utf-8"?>
<metadata>
<layout title="COM_JEM_CALENDAR_VIEW_DEFAULT_TITLE">
<message>
<![CDATA[COM_JEM_CALENDAR_VIEW_DEFAULT_DESC]]>
</message>
</layout>
<fields name="params">
<fieldset name="basic"
addfieldpath="/administrator/components/com_jem/models/fields"
>
<field name="introtext" type="textarea"
filter="safehtml"
default=""
rows="8"
cols="30"
label="COM_JEM_INTROTEXT_FIELD"
description="COM_JEM_INTROTEXT_FIELD_DESC"
/>
<field name="showintrotext" type="radio"
default="0"
label="COM_JEM_DISPLAY_INTROTEXT"
description="COM_JEM_DISPLAY_INTROTEXT_DESC"
class="btn-group btn-group-yesno"
>
<option value="1">COM_JEM_SHOW</option>
<option value="0">COM_JEM_HIDE</option>
</field>
<field type="spacer" name="myspacer2" hr="true" />
<field name="top_category" type="categories"
default="0"
label="COM_JEM_SELECT_TOP_CATEGORY"
description="COM_JEM_SELECT_TOP_CATEGORY_DESC"
/>
<field name="displayLegend" type="list"
default="1"
label="COM_JEM_DISPLAY_LEGEND"
description="COM_JEM_DISPLAY_LEGEND_DESC"
>
<option value="0">JNO</option>
<option value="2">COM_JEM_ABOVE</option>
<option value="1">COM_JEM_BELOW</option>
</field>
<field name="show_only_start" type="radio"
default="0"
label="COM_JEM_SHOWONLYSTARTDAY"
description="COM_JEM_SHOWONLYSTARTDAY_DESC"
class="btn-group btn-group-yesno"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
<field name="firstweekday" type="list"
default="1"
label="COM_JEM_SELECTFIRSTWEEKDAY"
description="COM_JEM_SELECTFIRSTWEEKDAYDESC"
>
<option value="0">COM_JEM_SUNDAY</option>
<option value="1">COM_JEM_MONDAY</option>
</field>
<field name="daylimit" type="text"
default="10"
label="COM_JEM_MAX_EVENTS_PER_DAY"
description="COM_JEM_MAX_EVENTS_PER_DAY_DESC"
/>
<field name="show_addevent_icon" type="radio"
default="0"
label="COM_JEM_SHOWADDEVENTICON"
description="COM_JEM_SHOWADDEVENTICON_DESC"
class="btn-group btn-group-yesno"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
<field name="show_editevent_icon" type="radio"
default="0"
label="COM_JEM_SHOWEDITEVENTICON"
description="COM_JEM_SHOWEDITEVENTICON_DESC"
class="btn-group btn-group-yesno"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
<field name="show_copyevent_icon" type="radio"
default="0"
label="COM_JEM_SHOWCOPYEVENTICON"
description="COM_JEM_SHOWCOPYEVENTICON_DESC"
class="btn-group btn-group-yesno"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
<field type="spacer" name="myspacer3" hr="true" />
<field name="eventlinkcolor" type="color"
default="#000000"
label="COM_JEM_CALENDAR_EVENTLINKCOLOR"
description="COM_JEM_CALENDAR_EVENTLINKCOLOR_DESC"
/>
<field name="eventbackgroundcolor" type="color"
default="#FFFF00"
label="COM_JEM_CALENDAR_EVENTBACKGROUNDCOLOR"
description="COM_JEM_CALENDAR_EVENTBACKGROUNDCOLOR_DESC"
/>
<field name="eventbg_usecatcolor" type="radio"
default="0"
label="COM_JEM_CALENDAR_USECATCOLOR"
description="COM_JEM_CALENDAR_USECATCOLOR_DESC"
class="btn-group btn-group-yesno"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
<field name="currentdaycolor" type="color"
default="#CCCC99"
label="COM_JEM_CALENDAR_CURRENTDAYCOLOR"
description="COM_JEM_CALENDAR_CURRENTDAYCOLOR_DESC"
/>
<field name="eventandmorecolor" type="color"
default="#FFFF00"
label="COM_JEM_CALENDAR_EVENTANDMORECOLOR"
description="COM_JEM_CALENDAR_EVENTANDMORECOLOR_DESC"
/>
</fieldset>
</fields>
</metadata>

View File

@ -0,0 +1 @@
<!DOCTYPE html><title></title>

View File

@ -0,0 +1,413 @@
<?php
/**
* @version 2.3.1
* @package JEM
* @copyright (C) 2013-2021 joomlaeventmanager.net
* @copyright (C) 2005-2009 Christoph Lukes
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
*/
defined('_JEXEC') or die;
?>
<style>
td.today div.daynum::before,
td.today div.daynum::after {
background-color: <?php echo $this->params->get('currentdaycolor'); ?>;
}
</style>
<div id="jem" class="jlcalendar jem_calendar<?php echo $this->pageclass_sfx;?>">
<div class="buttons">
<?php
$btn_params = array('print_link' => $this->print_link);
echo JemOutput::createButtonBar($this->getName(), $this->permissions, $btn_params);
?>
</div>
<?php if ($this->params->get('show_page_heading', 1)): ?>
<h1 class="componentheading">
<?php echo $this->escape($this->params->get('page_heading')); ?>
</h1>
<?php endif; ?>
<?php if ($this->params->get('showintrotext')) : ?>
<div class="description no_space floattext">
<?php echo $this->params->get('introtext'); ?>
</div>
<p> </p>
<?php endif; ?>
<?php
$countcatevents = array ();
$countperday = array();
$limit = $this->params->get('daylimit', 10);
$evbg_usecatcolor = $this->params->get('eventbg_usecatcolor', 0);
$showtime = $this->settings->get('global_show_timedetails', 1);
foreach ($this->rows as $row) :
if (!JemHelper::isValidDate($row->dates)) {
continue; // skip, open date !
}
//get event date
$year = strftime('%Y', strtotime($row->dates));
$month = strftime('%m', strtotime($row->dates));
$day = strftime('%d', strtotime($row->dates));
@$countperday[$year.$month.$day]++;
if ($countperday[$year.$month.$day] == $limit+1) {
$var1a = JRoute::_('index.php?option=com_jem&view=day&id='.$year.$month.$day . $this->param_topcat);
$var1b = JText::_('COM_JEM_AND_MORE');
$var1c = "<a href=\"".$var1a."\">".$var1b."</a>";
$id = 'eventandmore';
$this->cal->setEventContent($year, $month, $day, $var1c, null, $id);
continue;
} elseif ($countperday[$year.$month.$day] > $limit+1) {
continue;
}
//for time in tooltip
$timehtml = '';
if ($showtime) {
$start = JemOutput::formattime($row->times);
$end = JemOutput::formattime($row->endtimes);
if ($start != '') {
$timehtml = '<div class="time"><span class="text-label">'.JText::_('COM_JEM_TIME_SHORT').': </span>';
$timehtml .= $start;
if ($end != '') {
$timehtml .= ' - '.$end;
}
$timehtml .= '</div>';
}
}
$eventname = '<div class="eventName">'.JText::_('COM_JEM_TITLE_SHORT').': '.$this->escape($row->title).'</div>';
$detaillink = JRoute::_(JemHelperRoute::getEventRoute($row->slug));
//initialize variables
$multicatname = '';
$colorpic = '';
$nr = is_array($row->categories) ? count($row->categories) : 0;
$ix = 0;
$content = '';
$contentend = '';
$catcolor = array();
//walk through categories assigned to an event
foreach((array)$row->categories AS $category) {
//Currently only one id possible...so simply just pick one up...
$detaillink = JRoute::_(JemHelperRoute::getEventRoute($row->slug));
//wrap a div for each category around the event for show hide toggler
$content .= '<div id="catz" class="cat'.$category->id.'">';
$contentend .= '</div>';
//attach category color if any in front of the catname
if ($category->color) {
$multicatname .= '<span class="colorpic" style="width:6px; background-color: '.$category->color.';"></span>&nbsp;'.$category->catname;
} else {
$multicatname .= $category->catname;
}
$ix++;
if ($ix != $nr) {
$multicatname .= ', ';
}
//attach category color if any in front of the event title in the calendar overview
if (isset($category->color) && $category->color) {
$colorpic .= '<span class="colorpic" style="width:6px; background-color: '.$category->color.';"></span>';
$catcolor[$category->color] = $category->color; // we need to list all different colors of this event
}
//count occurence of the category
if (!isset($row->multi) || ($row->multi == 'first')) {
if (!array_key_exists($category->id, $countcatevents)) {
$countcatevents[$category->id] = 1;
} else {
$countcatevents[$category->id]++;
}
}
}
$color = '<div id="eventcontenttop" class="eventcontenttop">';
$color .= $colorpic;
$color .= '</div>';
// multiday
$multi_mode = 0; // single day
$multi_icon = '';
if (isset($row->multi)) {
switch ($row->multi) {
case 'first': // first day
$multi_mode = 1;
$multi_icon = '<i class="fa fa-step-backward" aria-hidden="true"></i>';
break;
case 'middle': // middle day
$multi_mode = 2;
$multi_icon = '<i class="fa fa-arrows-h fa-lg" aria-hidden="true"></i>';
break;
case 'zlast': // last day
$multi_mode = 3;
$multi_icon = '<i class="fa fa-step-forward" aria-hidden="true"></i>';
break;
}
}
//for time in calendar
$timetp = '';
if ($showtime) {
$start = JemOutput::formattime($row->times,'',false);
$end = JemOutput::formattime($row->endtimes,'',false);
switch ($multi_mode) {
case 1:
$timetp .= $multi_icon . ' ' . $start . '<br />';
break;
case 2:
$timetp .= $multi_icon . '<br />';
break;
case 3:
$timetp .= $multi_icon . ' ' . $end . '<br />';
break;
default:
if ($start != '') {
$timetp .= $start;
if ($end != '') {
$timetp .= ' - '.$end;
}
$timetp .= '<br />';
}
break;
}
} else {
if (!empty($multi_icon)) {
$timetp .= $multi_icon . ' ';
}
}
$catname = '<div class="catname">'.$multicatname.'</div>';
$eventdate = !empty($row->multistartdate) ? JemOutput::formatdate($row->multistartdate) : JemOutput::formatdate($row->dates);
if (!empty($row->multienddate)) {
$eventdate .= ' - ' . JemOutput::formatdate($row->multienddate);
} else if ($row->enddates && $row->dates < $row->enddates) {
$eventdate .= ' - ' . JemOutput::formatdate($row->enddates);
}
//venue
if ($this->jemsettings->showlocate == 1) {
$venue = '<div class="location"><span class="text-label">'.JText::_('COM_JEM_VENUE_SHORT').': </span>';
$venue .= !empty($row->venue) ? $this->escape($row->venue) : '-';
$venue .= '</div>';
} else {
$venue = '';
}
// state if unpublished
$statusicon = '';
if (isset($row->published) && ($row->published != 1)) {
$statusicon = JemOutput::publishstateicon($row);
$eventstate = '<div class="eventstate"><span class="text-label">'.JText::_('JSTATUS').': </span>';
switch ($row->published) {
case 1: $eventstate .= JText::_('JPUBLISHED'); break;
case 0: $eventstate .= JText::_('JUNPUBLISHED'); break;
case 2: $eventstate .= JText::_('JARCHIVED'); break;
case -2: $eventstate .= JText::_('JTRASHED'); break;
}
$eventstate .= '</div>';
} else {
$eventstate = '';
}
//date in tooltip
$multidaydate = '<div class="time"><span class="text-label">'.JText::_('COM_JEM_DATE').': </span>';
switch ($multi_mode) {
case 1: // first day
$multidaydate .= JemOutput::formatShortDateTime($row->dates, $row->times, $row->enddates, $row->endtimes, $showtime);
$multidaydate .= JemOutput::formatSchemaOrgDateTime($row->dates, $row->times, $row->enddates, $row->endtimes);
break;
case 2: // middle day
$multidaydate .= JemOutput::formatShortDateTime($row->multistartdate, $row->times, $row->multienddate, $row->endtimes, $showtime);
$multidaydate .= JemOutput::formatSchemaOrgDateTime($row->multistartdate, $row->times, $row->multienddate, $row->endtimes);
break;
case 3: // last day
$multidaydate .= JemOutput::formatShortDateTime($row->multistartdate, $row->times, $row->multienddate, $row->endtimes, $showtime);
$multidaydate .= JemOutput::formatSchemaOrgDateTime($row->multistartdate, $row->times, $row->multienddate, $row->endtimes);
break;
default: // single day
$multidaydate .= JemOutput::formatShortDateTime($row->dates, $row->times, $row->enddates, $row->endtimes, $showtime);
$multidaydate .= JemOutput::formatSchemaOrgDateTime($row->dates, $row->times, $row->enddates, $row->endtimes);
break;
}
$multidaydate .= '</div>';
//create little Edit and/or Copy icon on top right corner of event if user is allowed to edit and/or create
$editicon = '';
if (!$this->print) {
$btns = array();
if ($this->params->get('show_editevent_icon', 0) && $row->params->get('access-edit', false)) {
$btns[] = JemOutput::editbutton($row, null, null, true, 'editevent');
}
if ($this->params->get('show_copyevent_icon', 0) && $this->permissions->canAddEvent) {
$btns[] = JemOutput::copybutton($row, null, null, true, 'editevent');
}
if (!empty($btns)) {
$editicon .= '<div class="inline-button-right">';
$editicon .= join(' ', $btns);
$editicon .= '</div>';
}
}
//generate the output
// if we have exact one color from categories we can use this as background color of event
if (!empty($evbg_usecatcolor) && (count($catcolor) == 1)) {
$content .= '<div class="eventcontentinner" style="background-color:'.array_pop($catcolor).'" onclick=location.href="'.$detaillink.'">';
$content .= $editicon;
$content .= JemHelper::caltooltip($catname.$eventname.$timehtml.$venue.$eventstate, $eventdate, $row->title . $statusicon, $detaillink, 'editlinktip hasTip', $timetp, $category->color);
$content .= $contentend . '</div>';
} else {
$content .= '<div class="eventcontentinner" onclick=location.href="'.$detaillink.'">' . $colorpic;
$content .= $editicon;
$content .= JemHelper::caltooltip($catname.$eventname.$timehtml.$venue.$eventstate, $eventdate, $row->title . $statusicon, $detaillink, 'editlinktip hasTip', $timetp, $category->color);
$content .= $contentend . '</div>';
}
$this->cal->setEventContent($year, $month, $day, $content);
endforeach;
// enable little icon right beside day number to allow event creation
if (!$this->print && $this->params->get('show_addevent_icon', 0) && !empty($this->permissions->canAddEvent)) {
$html = JemOutput::prepareAddEventButton();
$this->cal->enableNewEventLinks($html);
}
$displayLegend = (int)$this->params->get('displayLegend', 1);
if ($displayLegend == 2) : ?>
<!-- Calendar legend above -->
<div id="jlcalendarlegend">
<!-- Calendar buttons -->
<div class="calendarButtons jem-row jem-justify-start">
<button id="buttonshowall" class="calendarButton btn btn-outline-dark">
<?php echo JText::_('COM_JEM_SHOWALL'); ?>
</button>
<button id="buttonhideall" class="calendarButton btn btn-outline-dark">
<?php echo JText::_('COM_JEM_HIDEALL'); ?>
</button>
</div>
<!-- Calendar Legend -->
<div class="calendarLegends jem-row jem-justify-start">
<?php
if ($this->params->get('displayLegend')) {
##############
## FOR EACH ##
##############
$counter = array();
# walk through events
foreach ($this->rows as $row) {
foreach ($row->categories as $cat) {
# sort out dupes for the counter (catid-legend)
if (!in_array($cat->id, $counter)) {
# add cat id to cat counter
$counter[] = $cat->id;
# build legend
if (array_key_exists($cat->id, $countcatevents)) {
?>
<button class="eventCat btn btn-outline-dark" id="cat<?php echo $cat->id; ?>">
<?php
if (isset($cat->color) && $cat->color) {
echo '<span class="colorpic" style="background-color: '.$cat->color.';"></span>';
}
echo $cat->catname.' ('.$countcatevents[$cat->id].')';
?>
</button>
<?php
}
}
}
}
}
?>
</div>
</div>
<?php endif; ?>
<?php
// print the calendar
echo $this->cal->showMonth();
?>
<?php if (($displayLegend == 1) || ($displayLegend == 0)) : ?>
<!-- Calendar legend below -->
<div id="jlcalendarlegend">
<!-- Calendar buttons -->
<div class="calendarButtons jem-row jem-justify-start">
<button id="buttonshowall" class="btn btn-outline-dark">
<?php echo JText::_('COM_JEM_SHOWALL'); ?>
</button>
<button id="buttonhideall" class="btn btn-outline-dark">
<?php echo JText::_('COM_JEM_HIDEALL'); ?>
</button>
</div>
<!-- Calendar Legend -->
<div class="calendarLegends jem-row jem-justify-start">
<?php
if ($displayLegend == 1) {
##############
## FOR EACH ##
##############
$counter = array();
# walk through events
foreach ($this->rows as $row) {
foreach ($row->categories as $cat) {
# sort out dupes for the counter (catid-legend)
if (!in_array($cat->id, $counter)) {
# add cat id to cat counter
$counter[] = $cat->id;
# build legend
if (array_key_exists($cat->id, $countcatevents)) {
?>
<button class="eventCat btn btn-outline-dark" id="cat<?php echo $cat->id; ?>">
<?php
if (isset($cat->color) && $cat->color) {
echo '<span class="colorpic" style="background-color: '.$cat->color.';"></span>';
}
echo $cat->catname.' ('.$countcatevents[$cat->id].')';
?>
</button>
<?php
}
}
}
}
}
?>
</div>
</div>
<?php endif; ?>
<div class="clr"></div>
<div class="copyright">
<?php echo JemOutput::footer(); ?>
</div>
</div>

View File

@ -0,0 +1 @@
<!DOCTYPE html><title></title>

View File

@ -0,0 +1,136 @@
<?php
/**
* @version 2.3.1
* @package JEM
* @copyright (C) 2013-2021 joomlaeventmanager.net
* @copyright (C) 2005-2009 Christoph Lukes
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
*/
defined('_JEXEC') or die;
/**
* Calendar-View
*/
class JemViewCalendar extends JemView
{
/**
* Calendar-View
*/
public function display($tpl = null)
{
$app = JFactory::getApplication();
// Load tooltips behavior
JHtml::_('behavior.tooltip');
JHtml::_('behavior.framework');
// initialize variables
$document = JFactory::getDocument();
$menu = $app->getMenu();
$menuitem = $menu->getActive();
$jemsettings = JemHelper::config();
$settings = JemHelper::globalattribs();
$user = JemFactory::getUser();
$params = $app->getParams();
$top_category = (int)$params->get('top_category', 0);
$jinput = $app->input;
$print = $jinput->getBool('print', false);
$this->param_topcat = $top_category > 0 ? ('&topcat='.$top_category) : '';
// Load css
JemHelper::loadCss('jem');
JemHelper::loadCss('calendar');
JemHelper::loadCustomCss();
JemHelper::loadCustomTag();
if ($print) {
JemHelper::loadCss('print');
$document->setMetaData('robots', 'noindex, nofollow');
}
$evlinkcolor = $params->get('eventlinkcolor');
$evbackgroundcolor = $params->get('eventbackgroundcolor');
$currentdaycolor = $params->get('currentdaycolor');
$eventandmorecolor = $params->get('eventandmorecolor');
$style = '
div#jem .eventcontentinner a,
div#jem .eventandmore a {
color:' . $evlinkcolor . ';
}
.eventcontentinner {
background-color:'.$evbackgroundcolor .';
}
.eventandmore {
background-color:'.$eventandmorecolor .';
}
.today .daynum {
background-color:'.$currentdaycolor.';
}';
$document->addStyleDeclaration($style);
// add javascript (using full path - see issue #590)
JHtml::_('script', 'media/com_jem/js/calendar.js');
$year = (int)$jinput->getInt('yearID', strftime("%Y"));
$month = (int)$jinput->getInt('monthID', strftime("%m"));
// get data from model and set the month
$model = $this->getModel();
$model->setDate(mktime(0, 0, 1, $month, 1, $year));
$rows = $this->get('Items');
// Set Page title
$pagetitle = $params->def('page_title', $menuitem->title);
$params->def('page_heading', $pagetitle);
$pageclass_sfx = $params->get('pageclass_sfx');
// Add site name to title if param is set
if ($app->getCfg('sitename_pagetitles', 0) == 1) {
$pagetitle = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $pagetitle);
}
elseif ($app->getCfg('sitename_pagetitles', 0) == 2) {
$pagetitle = JText::sprintf('JPAGETITLE', $pagetitle, $app->getCfg('sitename'));
}
$document->setTitle($pagetitle);
$document->setMetaData('title', $pagetitle);
// Check if the user has permission to add things
$permissions = new stdClass();
$catIds = $model->getCategories('all');
$permissions->canAddEvent = $user->can('add', 'event', false, false, $catIds);
$permissions->canAddVenue = $user->can('add', 'venue', false, false, $catIds);
$itemid = $jinput->getInt('Itemid', 0);
$partItemid = ($itemid > 0) ? '&Itemid=' . $itemid : '';
$partDate = ($year ? ('&yearID=' . $year) : '') . ($month ? ('&monthID=' . $month) : '');
$url_base = 'index.php?option=com_jem&view=calendar' . $partItemid;
$print_link = JRoute::_($url_base . $partDate . '&print=1&tmpl=component');
// init calendar
$cal = new JemCalendar($year, $month, 0);
$cal->enableMonthNav($url_base . ($print ? '&print=1&tmpl=component' : ''));
$cal->setFirstWeekDay($params->get('firstweekday', 1));
$cal->enableDayLinks('index.php?option=com_jem&view=day' . $this->param_topcat);
$this->rows = $rows;
$this->catIds = $catIds;
$this->params = $params;
$this->jemsettings = $jemsettings;
$this->settings = $settings;
$this->permissions = $permissions;
$this->cal = $cal;
$this->pageclass_sfx = htmlspecialchars($pageclass_sfx);
$this->print_link = $print_link;
$this->print = $print;
parent::display($tpl);
}
}
?>

View File

@ -0,0 +1 @@
<!DOCTYPE html><title></title>

View File

@ -0,0 +1,480 @@
<?php
/**
* @package JEM
* @copyright (C) 2013-2024 joomlaeventmanager.net
* @copyright (C) 2005-2009 Christoph Lukes
* @license https://www.gnu.org/licenses/gpl-3.0 GNU/GPL
*/
defined('_JEXEC') or die;
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Factory;
use Joomla\CMS\Uri\Uri;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Date\Date;
HTMLHelper::addIncludePath(JPATH_COMPONENT . '/helpers');
// Create shortcuts to some parameters.
$params = $this->item->params;
$images = json_decode($this->item->datimage);
$attribs = json_decode($this->item->attribs);
$user = JemFactory::getUser();
$jemsettings = JemHelper::config();
$app = Factory::getApplication();
$document = $app->getDocument();
$uri = Uri::getInstance();
// Add expiration date, if old events will be archived or removed
if ($jemsettings->oldevent > 0) {
$enddate = strtotime($this->item->enddates?:($this->item->dates?:date("Y-m-d")));
$expDate = date("D, d M Y H:i:s", strtotime('+1 day', $enddate));
$document->addCustomTag('<meta http-equiv="expires" content="' . $expDate . '"/>');
}
?>
<?php if ($params->get('access-view')) { /* This will show nothings otherwise - ??? */ ?>
<div id="jem" class="event_id<?php echo $this->item->did; ?> jem_event<?php echo $this->pageclass_sfx;?>"
itemscope="itemscope" itemtype="https://schema.org/Event">
<meta itemprop="url" content="<?php echo rtrim($uri->base(), '/').Route::_(JemHelperRoute::getEventRoute($this->item->slug)); ?>" />
<meta itemprop="identifier" content="<?php echo rtrim($uri->base(), '/').Route::_(JemHelperRoute::getEventRoute($this->item->slug)); ?>" />
<div class="buttons">
<?php
$btn_params = array('slug' => $this->item->slug, 'print_link' => $this->print_link);
echo JemOutput::createButtonBar($this->getName(), $this->permissions, $btn_params);
?>
</div>
<div class="clr"> </div>
<?php if ($this->params->get('show_page_heading', 1)) : ?>
<h1 class="componentheading">
<?php echo $this->escape($this->params->get('page_heading')); ?>
</h1>
<?php endif; ?>
<div class="clr"> </div>
<!-- Event -->
<h2 class="jem">
<span style="white-space: nowrap;">
<?php
echo Text::_('COM_JEM_EVENT') . JemOutput::recurrenceicon($this->item) .' ';
if($this->item_root) {
echo JemOutput::editbutton($this->item_root, $params, $attribs, $this->permissions->canEditEvent, 'editevent') . ' ';
}
if(!$this->item_root || ($this->item_root && $this->item->recurrence_first_id)) {
echo JemOutput::editbutton($this->item, $params, $attribs, $this->permissions->canEditEvent, 'editevent') . ' ';
}
echo JemOutput::copybutton($this->item, $params, $attribs, $this->permissions->canAddEvent, 'editevent');
?>
</span>
</h2>
<?php echo JemOutput::flyer($this->item, $this->dimage, 'event'); ?>
<dl class="event_info floattext">
<?php if ($params->get('event_show_detailstitle',1)) : ?>
<dt class="title"><?php echo Text::_('COM_JEM_TITLE'); ?>:</dt>
<dd class="title" itemprop="name"><?php echo $this->escape($this->item->title); ?></dd>
<?php
endif;
?>
<dt class="when"><?php echo Text::_('COM_JEM_WHEN'); ?>:</dt>
<dd class="when">
<?php
echo JemOutput::formatLongDateTime($this->item->dates, $this->item->times,$this->item->enddates, $this->item->endtimes);
echo JemOutput::formatSchemaOrgDateTime($this->item->dates, $this->item->times,$this->item->enddates, $this->item->endtimes);
?>
</dd>
<?php if ($this->item->locid != 0) : ?>
<dt class="where"><?php echo Text::_('COM_JEM_WHERE'); ?>:</dt>
<dd class="where"><?php
if (($params->get('event_show_detlinkvenue') == 1) && (!empty($this->item->url))) :
?><a target="_blank" href="<?php echo $this->item->url; ?>"><?php echo $this->escape($this->item->venue); ?></a><?php
elseif (($params->get('event_show_detlinkvenue') == 2) && (!empty($this->item->venueslug))) :
?><a href="<?php echo Route::_(JemHelperRoute::getVenueRoute($this->item->venueslug)); ?>"><?php echo $this->item->venue; ?></a><?php
else/*if ($params->get('event_show_detlinkvenue') == 0)*/ :
echo $this->escape($this->item->venue);
endif;
# will show "venue" or "venue - city" or "venue - city, state" or "venue, state"
$city = $this->escape($this->item->city);
$state = $this->escape($this->item->state);
if ($city) { echo ' - ' . $city; }
if ($state) { echo ', ' . $state; }
?>
</dd>
<?php
endif;
$n = is_array($this->categories) ? count($this->categories) : 0;
?>
<dt class="category"><?php echo $n < 2 ? Text::_('COM_JEM_CATEGORY') : Text::_('COM_JEM_CATEGORIES'); ?>:</dt>
<dd class="category">
<?php
$i = 0;
foreach ((array)$this->categories as $category) :
?><a href="<?php echo Route::_(JemHelperRoute::getCategoryRoute($category->catslug)); ?>"><?php echo $this->escape($category->catname); ?></a><?php
$i++;
if ($i != $n) :
echo ', ';
endif;
endforeach;
?>
</dd>
<?php
for ($cr = 1; $cr <= 10; $cr++) {
$currentRow = $this->item->{'custom'.$cr};
if (preg_match('%^http(s)?://%', $currentRow)) {
$currentRow = '<a href="'.$this->escape($currentRow).'" target="_blank">'.$this->escape($currentRow).'</a>';
}
if ($currentRow) {
?>
<dt class="custom<?php echo $cr; ?>"><?php echo Text::_('COM_JEM_EVENT_CUSTOM_FIELD'.$cr); ?>:</dt>
<dd class="custom<?php echo $cr; ?>"><?php echo $currentRow; ?></dd>
<?php
}
}
?>
<?php if ($params->get('event_show_hits')) : ?>
<dt class="hits"><?php echo Text::_('COM_JEM_EVENT_HITS_LABEL'); ?>:</dt>
<dd class="hits"><?php echo Text::sprintf('COM_JEM_EVENT_HITS', $this->item->hits); ?></dd>
<?php endif; ?>
<!-- AUTHOR -->
<?php if ($params->get('event_show_author') && !empty($this->item->author)) : ?>
<dt class="createdby"><?php echo Text::_('COM_JEM_EVENT_CREATED_BY_LABEL'); ?>:</dt>
<dd class="createdby">
<?php $author = $this->item->created_by_alias ? $this->item->created_by_alias : $this->item->author; ?>
<?php if (!empty($this->item->contactid2) && $params->get('event_link_author') == true) :
$needle = 'index.php?option=com_contact&view=contact&id=' . $this->item->contactid2 . '&catid=' . $this->item->concatid;
$menu = Factory::getApplication()->getMenu();
$item = $menu->getItems('link', $needle, true);
$cntlink = !empty($item) ? $needle . '&Itemid=' . $item->id : $needle;
echo Text::sprintf('COM_JEM_EVENT_CREATED_BY', HTMLHelper::_('link', Route::_($cntlink), $author));
else :
echo Text::sprintf('COM_JEM_EVENT_CREATED_BY', $author);
endif;
?>
</dd>
<?php endif; ?>
<!-- PUBLISHING STATE -->
<?php if (!empty($this->showeventstate) && isset($this->item->published)) : ?>
<dt class="published"><?php echo Text::_('JSTATUS'); ?>:</dt>
<dd class="published">
<?php switch ($this->item->published) {
case 1: echo Text::_('JPUBLISHED'); break;
case 0: echo Text::_('JUNPUBLISHED'); break;
case 2: echo Text::_('JARCHIVED'); break;
case -2: echo Text::_('JTRASHED'); break;
} ?>
</dd>
<?php endif; ?>
</dl>
<!-- DESCRIPTION -->
<?php if ($params->get('event_show_description','1') && ($this->item->fulltext != '' && $this->item->fulltext != '<br />' || $this->item->introtext != '' && $this->item->introtext != '<br />')) { ?>
<h2 class="description"><?php echo Text::_('COM_JEM_EVENT_DESCRIPTION'); ?></h2>
<div class="description event_desc" itemprop="description">
<?php
if ($params->get('access-view')) {
echo $this->item->text;
}
/* optional teaser intro text for guests - NOT SUPPORTED YET */
elseif (0 /*$params->get('event_show_noauth') == true and $user->get('guest')*/ ) {
echo $this->item->introtext;
// Optional link to let them register to see the whole event.
if ($params->get('event_show_readmore') && $this->item->fulltext != null) {
$link1 = Route::_('index.php?option=com_users&view=login');
$link = new JUri($link1);
echo '<p class="readmore">';
echo '<a href="'.$link.'">';
if ($params->get('event_alternative_readmore') == false) {
echo Text::_('COM_JEM_EVENT_REGISTER_TO_READ_MORE');
} elseif ($readmore = $params->get('alternative_readmore')) {
echo $readmore;
}
if ($params->get('event_show_readmore_title', 0) != 0) {
echo HTMLHelper::_('string.truncate', ($this->item->title), $params->get('event_readmore_limit'));
} elseif ($params->get('event_show_readmore_title', 0) == 0) {
} else {
echo HTMLHelper::_('string.truncate', ($this->item->title), $params->get('event_readmore_limit'));
} ?>
</a>
</p>
<?php
}
} /* access_view / show_noauth */
?>
</div>
<?php } ?>
<!-- Contact -->
<?php if ($params->get('event_show_contact') && !empty($this->item->conid )) : ?>
<h2 class="contact"><?php echo Text::_('COM_JEM_CONTACT') ; ?></h2>
<dl class="location floattext">
<dt class="con_name"><?php echo Text::_('COM_JEM_NAME'); ?>:</dt>
<dd class="con_name">
<?php
$contact = $this->item->conname;
if ($params->get('event_link_contact') == true) :
$needle = 'index.php?option=com_contact&view=contact&id=' . $this->item->conid . '&catid=' . $this->item->concatid;
$menu = Factory::getApplication()->getMenu();
$item = $menu->getItems('link', $needle, true);
$cntlink2 = !empty($item) ? $needle . '&Itemid=' . $item->id : $needle;
echo Text::sprintf('COM_JEM_EVENT_CONTACT', HTMLHelper::_('link', Route::_($cntlink2), $contact));
else :
echo Text::sprintf('COM_JEM_EVENT_CONTACT', $contact);
endif;
?>
</dd>
<?php if ($this->item->contelephone) : ?>
<dt class="con_telephone"><?php echo Text::_('COM_JEM_TELEPHONE'); ?>:</dt>
<dd class="con_telephone">
<?php echo $this->escape($this->item->contelephone); ?>
</dd>
<?php endif; ?>
</dl>
<?php endif ?>
<?php $this->attachments = $this->item->attachments; ?>
<?php echo $this->loadTemplate('attachments'); ?>
<!-- Venue -->
<?php if (($this->item->locid != 0) && !empty($this->item->venue) && $params->get('event_show_venue', '1')) : ?>
<p></p>
<hr />
<div class="venue_id<?php echo $this->item->locid; ?>" itemprop="location" itemscope="itemscope" itemtype="https://schema.org/Place">
<meta itemprop="name" content="<?php echo $this->escape($this->item->venue); ?>" />
<?php $itemid = $this->item ? $this->item->id : 0 ; ?>
<h2 class="location">
<?php
echo Text::_('COM_JEM_VENUE') ;
$itemid = $this->item ? $this->item->id : 0 ;
echo JemOutput::editbutton($this->item, $params, $attribs, $this->permissions->canEditVenue, 'editvenue');
echo JemOutput::copybutton($this->item, $params, $attribs, $this->permissions->canAddVenue, 'editvenue');
?>
</h2>
<?php echo JemOutput::flyer($this->item, $this->limage, 'venue'); ?>
<dl class="location">
<dt class="venue"><?php echo Text::_('COM_JEM_LOCATION'); ?>:</dt>
<dd class="venue">
<?php
if (!empty($this->item->venueslug)) :
echo '<a href="' . Route::_(JemHelperRoute::getVenueRoute($this->item->venueslug)) . '">' . $this->escape($this->item->venue) . '</a>';
else :
echo $this->escape($this->item->venue);
endif;
if (!empty($this->item->url)) :
echo '&nbsp;-&nbsp;<a target="_blank" href="' . $this->item->url . '">' . Text::_('COM_JEM_WEBSITE') . '</a>';
endif;
?>
</dd>
</dl>
<?php if ($params->get('event_show_detailsadress', '1')) : ?>
<dl class="location floattext" itemprop="address" itemscope
itemtype="https://schema.org/PostalAddress">
<?php if ($this->item->street) : ?>
<dt class="venue_street"><?php echo Text::_('COM_JEM_STREET'); ?>:</dt>
<dd class="venue_street" itemprop="streetAddress">
<?php echo $this->escape($this->item->street); ?>
</dd>
<?php endif; ?>
<?php if ($this->item->postalCode) : ?>
<dt class="venue_postalCode"><?php echo Text::_('COM_JEM_ZIP'); ?>:</dt>
<dd class="venue_postalCode" itemprop="postalCode">
<?php echo $this->escape($this->item->postalCode); ?>
</dd>
<?php endif; ?>
<?php if ($this->item->city) : ?>
<dt class="venue_city"><?php echo Text::_('COM_JEM_CITY'); ?>:</dt>
<dd class="venue_city" itemprop="addressLocality">
<?php echo $this->escape($this->item->city); ?>
</dd>
<?php endif; ?>
<?php if ($this->item->state) : ?>
<dt class="venue_state"><?php echo Text::_('COM_JEM_STATE'); ?>:</dt>
<dd class="venue_state" itemprop="addressRegion">
<?php echo $this->escape($this->item->state); ?>
</dd>
<?php endif; ?>
<?php if ($this->item->country) : ?>
<dt class="venue_country"><?php echo Text::_('COM_JEM_COUNTRY'); ?>:</dt>
<dd class="venue_country">
<?php echo $this->item->countryimg ? $this->item->countryimg : $this->item->country; ?>
<meta itemprop="addressCountry" content="<?php echo $this->item->country; ?>" />
</dd>
<?php endif; ?>
<!-- PUBLISHING STATE -->
<?php if (!empty($this->showvenuestate) && isset($this->item->locpublished)) : ?>
<dt class="venue_published"><?php echo Text::_('JSTATUS'); ?>:</dt>
<dd class="venue_published">
<?php switch ($this->item->locpublished) {
case 1: echo Text::_('JPUBLISHED'); break;
case 0: echo Text::_('JUNPUBLISHED'); break;
case 2: echo Text::_('JARCHIVED'); break;
case -2: echo Text::_('JTRASHED'); break;
} ?>
</dd>
<?php endif; ?>
<?php
for ($cr = 1; $cr <= 10; $cr++) {
$currentRow = $this->item->{'venue'.$cr};
if (preg_match('%^http(s)?://%', $currentRow)) {
$currentRow = '<a href="' . $this->escape($currentRow) . '" target="_blank">' . $this->escape($currentRow) . '</a>';
}
if ($currentRow) {
?>
<dt class="custom<?php echo $cr; ?>"><?php echo Text::_('COM_JEM_VENUE_CUSTOM_FIELD'.$cr); ?>:</dt>
<dd class="custom<?php echo $cr; ?>"><?php echo $currentRow; ?></dd>
<?php
}
}
?>
<?php if ($params->get('event_show_mapserv') == 1 || $params->get('event_show_mapserv') == 4) : ?>
<?php echo JemOutput::mapicon($this->item, 'event', $params); ?>
<?php endif; ?>
</dl>
<?php if ($params->get('event_show_mapserv') == 2 || $params->get('event_show_mapserv') == 5) : ?>
<div class="jem-map">
<?php echo JemOutput::mapicon($this->item, 'event', $params); ?>
</div>
<?php endif; ?>
<?php if ($params->get('event_show_mapserv') == 3) : ?>
<input type="hidden" id="latitude" value="<?php echo $this->item->latitude; ?>">
<input type="hidden" id="longitude" value="<?php echo $this->item->longitude; ?>">
<input type="hidden" id="venue" value="<?php echo $this->item->venue; ?>">
<input type="hidden" id="street" value="<?php echo $this->item->street; ?>">
<input type="hidden" id="city" value="<?php echo $this->item->city; ?>">
<input type="hidden" id="state" value="<?php echo $this->item->state; ?>">
<input type="hidden" id="postalCode" value="<?php echo $this->item->postalCode; ?>">
<?php echo JemOutput::mapicon($this->item, 'event', $params); ?>
<?php endif; ?>
<?php endif; /* event_show_detailsadress */ ?>
<?php if ($params->get('event_show_locdescription', '1') && $this->item->locdescription != ''
&& $this->item->locdescription != '<br />') : ?>
<h2 class="location_desc"><?php echo Text::_('COM_JEM_VENUE_DESCRIPTION'); ?></h2>
<div class="description location_desc" itemprop="description">
<?php echo $this->item->locdescription; ?>
</div>
<?php endif; ?>
<?php $this->attachments = $this->item->vattachments; ?>
<?php echo $this->loadTemplate('attachments'); ?>
</div>
<?php endif; ?>
<!-- Registration -->
<?php if ($this->showAttendees && $params->get('event_show_registration', '1')) : ?>
<hr class="jem-hr">
<h2 class="register"><?php echo Text::_('COM_JEM_REGISTRATION'); ?></h2>
<?php
$timeNow = time();
switch ($this->e_reg) {
case 0:
//Event without registration (NO)
echo Text::_('COM_JEM_VENUE_DESCRIPTION');
break;
case 1:
//Event with registration (YES with or witout UNTIL)
echo $this->loadTemplate('attendees');
if($this->dateUnregistationUntil) {
echo ($this->allowAnnulation? Text::_('COM_JEM_EVENT_ANNULATION_NOTWILLBE_FROM') : Text::_('COM_JEM_EVENT_ANNULATION_ISNOT_FROM')) . ' ' . HTMLHelper::_('date', $this->dateUnregistationUntil, Text::_('DATE_FORMAT_LC2'));
}
break;
case 2:
//Event with date starting registration (FROM with or witout UNTIL)
if($this->dateRegistationFrom > $timeNow) {
echo Text::_('COM_JEM_EVENT_REGISTRATION_WILLBE_FROM') . ' ' . HTMLHelper::_('date', $this->dateRegistationFrom, Text::_('DATE_FORMAT_LC2'));
}else if ($this->allowRegistration) {
echo Text::_('COM_JEM_EVENT_REGISTRATION_IS_FROM') . ' ' . HTMLHelper::_('date', $this->dateRegistationFrom, Text::_('DATE_FORMAT_LC2'));
if($this->dateRegistationUntil){
echo " " . mb_strtolower(Text::_('COM_JEM_UNTIL')) . ' ' . HTMLHelper::_('date', $this->dateRegistationUntil, Text::_('DATE_FORMAT_LC2'));
}
echo $this->loadTemplate('attendees');
//Event with date starting annulation
if($this->dateUnregistationUntil) {
echo "<br>" . ($this->allowAnnulation? Text::_('COM_JEM_EVENT_ANNULATION_NOTWILLBE_FROM') : Text::_('COM_JEM_EVENT_ANNULATION_ISNOT_FROM')) . ' ' . HTMLHelper::_('date', $this->dateUnregistationUntil, Text::_('DATE_FORMAT_LC2'));
}
}else if($this->dateRegistationUntil !== false && $this->dateRegistationUntil < $timeNow) {
echo Text::_('COM_JEM_EVENT_REGISTRATION_WAS_UNTIL') . ' ' . HTMLHelper::_('date', $this->dateRegistationUntil, Text::_('DATE_FORMAT_LC2'));
echo $this->loadTemplate('attendees');
//Event with date starting annulation
if($this->dateUnregistationUntil) {
echo ($this->allowAnnulation? Text::_('COM_JEM_EVENT_ANNULATION_NOTWILLBE_FROM') : Text::_('COM_JEM_EVENT_ANNULATION_ISNOT_FROM')) . ' ' . HTMLHelper::_('date', $this->dateUnregistationUntil, Text::_('DATE_FORMAT_LC2'));
}
} else {
// open registration to the end of event
if($this->item->enddates){
$endDateEvent = strtotime($this->item->enddates . ' ' . ($this->item->endtimes ? $this->item->endtimes : '23:59:59'));
if($timeNow <= $endDateEvent){
echo Text::_('COM_JEM_EVENT_REGISTRATION_IS_UNTIL');
} else {
echo Text::_('COM_JEM_EVENT_REGISTRATION_WAS_UNTIL');
}
echo ' ' . HTMLHelper::_('date', $endDateEvent, Text::_('DATE_FORMAT_LC2'));
echo $this->loadTemplate('attendees');
}else{
if(!empty($this->item->dates)) {
$endDateEvent = strtotime($this->item->dates . ' ' . ($this->item->times ? $this->item->times : '23:59:59'));
if($timeNow <= $endDateEvent){
echo Text::_('COM_JEM_EVENT_REGISTRATION_IS_UNTIL');
} else {
echo Text::_('COM_JEM_EVENT_REGISTRATION_WAS_UNTIL');
}
echo ' ' . HTMLHelper::_('date', $endDateEvent, Text::_('DATE_FORMAT_LC2'));
echo $this->loadTemplate('attendees');
}
}
}
break;
}?>
<?php endif; ?>
<?php if (!empty($this->item->pluginevent->onEventEnd)) : ?>
<hr class="jem-hr">
<?php echo $this->item->pluginevent->onEventEnd; ?>
<?php endif; ?>
<div class="copyright">
<?php echo JemOutput::footer(); ?>
</div>
</div>
<?php }
echo JemOutput::lightbox();
?>

View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<metadata>
<layout title="COM_JEM_EVENT_VIEW_DEFAULT_TITLE">
<message>
<![CDATA[COM_JEM_EVENT_VIEW_DEFAULT_DESC]]>
</message>
</layout>
<fields name="request">
<fieldset name="request"
addfieldpath="/administrator/components/com_jem/models/fields"
>
<field name="id" type="event"
label="COM_JEM_SELECT_EVENT"
description="COM_JEM_SELECT_EVENT_DESC"
required="true"
/>
</fieldset>
</fields>
<!-- Add fields to the parameters object for the layout. -->
<fields name="params">
</fields>
</metadata>

View File

@ -0,0 +1,270 @@
<?php
/**
* @package JEM
* @copyright (C) 2013-2024 joomlaeventmanager.net
* @copyright (C) 2005-2009 Christoph Lukes
* @license https://www.gnu.org/licenses/gpl-3.0 GNU/GPL
*
* @todo add check if CB does exists and if so perform action
*/
defined('_JEXEC') or die;
use Joomla\CMS\Filesystem\File;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Uri\Uri;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Factory;
$linkreg = 'index.php?option=com_jem&amp;view=attendees&amp;id='.$this->item->id.($this->itemid ? '&Itemid='.$this->itemid : '');
?>
<div class="register">
<dl class="jem-dl floattext">
<?php $maxplaces = (int)$this->item->maxplaces; ?>
<?php $reservedplaces = (int)$this->item->reservedplaces; ?>
<?php $minbookeduser = (int)$this->item->minbookeduser; ?>
<?php $maxbookeduser = (int)$this->item->maxbookeduser; ?>
<?php $booked = (int)$this->item->booked; ?>
<?php $waitinglist = (int)$this->item->waitinglist; ?>
<?php $seriesbooking = (int)$this->item->seriesbooking; ?>
<?php if ($this->settings->get('event_show_registration_counters','1')) : ?>
<?php if ($maxplaces > 0) : ?>
<dt class="register max-places hasTooltip" data-original-title="<?php echo Text::_('COM_JEM_MAX_PLACES'); ?>"><?php echo Text::_('COM_JEM_MAX_PLACES'); ?>:</dt>
<dd class="register max-places"><?php echo $maxplaces; ?></dd>
<?php endif; ?>
<?php if (($maxplaces > 0) || ($reservedplaces > 0)) : ?>
<dt class="register booked-places hasTooltip" data-original-title="<?php echo Text::_('COM_JEM_RESERVED_PLACES'); ?>"><?php echo Text::_('COM_JEM_RESERVED_PLACES'); ?>:</dt>
<dd class="register booked-places">
<?php echo $reservedplaces; ?>
</dd>
<?php endif; ?>
<?php if ($maxplaces > 0) : ?>
<dt class="register booked-places hasTooltip" data-original-title="<?php echo Text::_('COM_JEM_BOOKED_PLACES'); ?>"><?php echo Text::_('COM_JEM_BOOKED_PLACES'); ?>:</dt>
<dd class="register booked-places"><?php echo $booked; ?></dd>
<?php endif; ?>
<?php if ($this->item->maxbookeduser > 0) : ?>
<dt><?php echo Text::_('COM_JEM_MAXIMUM_BOOKED_PLACES_PER_USER') ?>:</dt>
<dd><?php echo $this->item->maxbookeduser?></dd>
<?php endif; ?>
<?php if ($maxplaces > 0) : ?>
<dt class="register available-places hasTooltip" data-original-title="<?php echo Text::_('COM_JEM_AVAILABLE_PLACES'); ?>"><?php echo Text::_('COM_JEM_AVAILABLE_PLACES'); ?>:</dt>
<dd class="register available-places"><?php echo ($maxplaces - $booked - $reservedplaces); ?></dd>
<?php endif; ?>
<?php if ($waitinglist > 0) : ?>
<dt class="register waitinglist-places hasTooltip" data-original-title="<?php echo Text::_('COM_JEM_WAITING_PLACES'); ?>"><?php echo Text::_('COM_JEM_WAITING_PLACES'); ?>:</dt>
<dd class="register waitinglist-places"><?php echo $this->numWaitingPlaces; ?></dd>
<?php endif; ?>
<?php endif; /* Not show counters registration */ ?>
<?php
$this->registereduser = null;
// only set style info if users already have registered for event and user is allowed to see it
if ($this->registers) :
$showAttendenenames = $this->settings->get('event_show_attendeenames', 2);
switch ($showAttendenenames) {
case 1: // show to admins
if (!$this->user->authorise('core.manage', 'com_jem')) {
$showAttendenenames = 0;
}
break;
case 2: // show to registered
if ($this->user->get('guest')) {
$showAttendenenames = 0;
}
break;
case 3: // show to all
break;
case 4: // show only to user
break;
case 0: // show to none
default:
$showAttendenenames = 0;
}
if ($showAttendenenames) : ?>
<hr/>
<dt class="register registered-users hasTooltip" data-original-title="<?php echo Text::_('COM_JEM_REGISTERED_USERS'); ?>"><?php echo Text::_('COM_JEM_REGISTERED_USERS'); ?>:</dt>
<dd class="register registered-users">
<ul class="fa-ul jem-registered-list">
<?php
if ($this->settings->get('event_comunsolution', '0') == 1) :
if ($this->settings->get('event_comunoption', '0') == 1) :
//$cparams = ComponentHelper::getParams('com_media');
//$imgpath = $cparams->get('image_path'); // mostly 'images'
$imgpath = 'images'; // CB does NOT respect path set in Media Manager, so we have to ignore this too
if (File::exists(JPATH_ROOT . '/components/com_comprofiler/plugin/templates/default/images/avatar/tnnophoto_n.png')) {
$noimg = 'components/com_comprofiler/plugin/templates/default/images/avatar/tnnophoto_n.png';
} elseif (File::exists(JPATH_ROOT . '/components/com_comprofiler/images/english/tnnophoto.jpg')) {
$noimg = 'components/com_comprofiler/images/english/tnnophoto.jpg';
} else {
$noimg = '';
}
endif;
endif;
if(!function_exists("jem_getStatusIcon")) {
if ($this->settings->get('event_show_more_attendeedetails', '0')) {
function jem_getStatusIcon($status) {
switch($status) {
case 2: // waiting list
return ' <i class="fa fa-li fa-hourglass-half jem-attendance-status-fa-hourglass-half hasTooltip" title="'.Text::_('COM_JEM_ATTENDEES_ON_WAITINGLIST').'"></i>';
break;
case 1: // attending
return ' <i class="fa fa-li fa-check-circle jem-attendance-status-fa-check-circle hasTooltip" title="'.Text::_('COM_JEM_ATTENDEES_ATTENDING').'"></i>';
break;
case 0: // invited
return ' <i class="fa fa-li fa-question-circle jem-attendance-status-fa-question-circle hasTooltip" title="'.Text::_('COM_JEM_ATTENDEES_INVITED').'"></i>';
break;
case -1: // not attending
return ' <i class="fa fa-li fa-times-circle jem-attendance-status-fa-times-circle hasTooltip" title="'.Text::_('COM_JEM_ATTENDEES_NOT_ATTENDING').'"></i>';
break;
default:
return $status;
}
}
} else {
function jem_getStatusIcon($status) {
return ' <i class="fa fa-li fa-check-circle jem-attendance-status-fa-check-circle hasTooltip" title="'.Text::_('COM_JEM_ATTENDEES_ATTENDING').'"></i>';
}
}
}
foreach ($this->registers as $k => $register) :
if($showAttendenenames==4){
if($this->user->id != $register->uid){
continue;
}
} else if ($showAttendenenames==2) {
if($register->status==2){
continue;
}
}
echo '<li class="' . ($this->user->id==$register->uid? 'jem-registered-user-owner':'jem-registered-user') . '">' . jem_getStatusIcon($register->status);
$text = '';
$registedplaces = '';
// is a plugin catching this ?
if ($res = $this->dispatcher->triggerEvent('onAttendeeDisplay', array($register->uid, &$text))) :
echo $text;
endif;
//Registered user in the event
if($register->uid == $this->user->id) {
$this->registereduser = $k;
}
if($register->status==1 && $register->places>1){
$registedplaces = ' + ' . $register->places-1 . ' '. ($register->places-1>1? Text::_('COM_JEM_BOOKED_PLACES'): Text::_('COM_JEM_BOOKED_PLACE'));
}else if($register->status==-1 && $register->places>1){
$registedplaces = '';
}else if($register->status==0 && $register->places>1){
$registedplaces = ' + ' . $register->places-1 . ' '. ($register->places-1>1? Text::_('COM_JEM_INVITED_PLACES'): Text::_('COM_JEM_INVITED_PLACE'));
}else if($register->status==2 && $register->places>1){
$registedplaces = ' + ' . $register->places-1 . ' '. ($register->places-1>1? Text::_('COM_JEM_WAITING_PLACES'): Text::_('COM_JEM_WAITING_PLACE'));
}
// if CB
if ($this->settings->get('event_comunsolution', '0') == 1) :
$needle = 'index.php?option=com_comprofiler&view=userprofile';
$menu = Factory::getApplication()->getMenu();
$item = $menu->getItems('link', $needle, true);
$cntlink = !empty($item) ? $needle . '&user=' . $register->uid . '&Itemid=' . $item->id : $needle;
if ($this->settings->get('event_comunoption', '0') == 1) :
// User has avatar
if (!empty($register->avatar)) :
if (File::exists(JPATH_ROOT . '/' . $imgpath . '/comprofiler/tn' . $register->avatar)) {
$useravatar = HTMLHelper::image($imgpath . '/comprofiler/tn' . $register->avatar, $register->name);
} elseif (File::exists(JPATH_ROOT . '/' . $imgpath . '/comprofiler/' . $register->avatar)) {
$useravatar = HTMLHelper::image($imgpath . '/comprofiler/' . $register->avatar, $register->name);
} else {
$useravatar = empty($noimg) ? '' : HTMLHelper::image($noimg, $register->name);
}
echo '<a style="text-decoration: none;" href="' . Route::_($cntlink) . '" title = "' . Text::_('COM_JEM_SHOW_USER_PROFILE') . '">' . $useravatar . ' <span class="username">' . $register->name . '</span></a>' . $registedplaces;
// User has no avatar
else :
$nouseravatar = empty($noimg) ? '' : HTMLHelper::image($noimg, $register->name);
echo '<a style="text-decoration: none;" href="' . Route::_($cntlink) . '" title = "' . Text::_('COM_JEM_SHOW_USER_PROFILE') .'">' . $nouseravatar . ' <span class="username">' . $register->name . '</span></a>' . $registedplaces;
endif;
else :
// only show the username with link to profile
echo '<span class="username"><a style="text-decoration: none;" href="' . Route::_($cntlink) . '">' . $register->name . '</a></span>' . $registedplaces;
endif;
// if CB end - if not CB than only name
else :
// no communitycomponent is set so only show the username
echo '<span class="username">' . $register->name . '</span>' . $registedplaces;
endif;
echo '</li>';
// end loop through attendees
endforeach;
?>
</ul>
</dd>
<?php endif; ?>
<?php endif; ?>
<?php if ($this->permissions->canEditAttendees) : ?>
<dt></dt>
<dd><a href="<?php echo $linkreg; ?>" title="<?php echo Text::_('COM_JEM_MYEVENT_MANAGEATTENDEES'); ?>"><?php echo Text::_('COM_JEM_MYEVENT_MANAGEATTENDEES') ?> <i class="icon-out-2" aria-hidden="true"></i></a></dd>
<?php endif; ?>
</dl>
<hr />
<?php if ($this->print == 0) : ?>
<dl class="jem-dl floattext">
<dt class="register registration hasTooltip" data-original-title="<?php echo Text::_('COM_JEM_YOUR_REGISTRATION'); ?>"><?php echo Text::_('COM_JEM_YOUR_REGISTRATION'); ?>:</dt>
<dd class="register registration">
<?php
if ($this->item->published != 1) {
echo Text::_('COM_JEM_WRONG_STATE_FOR_REGISTER');
} elseif (!$this->showRegForm) {
echo Text::_('COM_JEM_NOT_ALLOWED_TO_REGISTER');
} else {
switch ($this->formhandler) {
case 0:
echo Text::_('COM_JEM_TOO_LATE_UNREGISTER');
break;
case 1:
echo Text::_('COM_JEM_TOO_LATE_REGISTER');
break;
case 2:
if ($this->item->requestanswer) { ?>
<span class="badge rounded-pill text-light bg-secondary">
<?php echo Text::_('COM_JEM_SEND_UNREGISTRATION');?>
</span>
<?php
}
$uri = Uri::getInstance();
$returnUrl = $uri->toString();
$urlLogin = Route::_($uri->root() . 'index.php?option=com_users&view=login&return='.base64_encode($returnUrl)); ?>
<button class="btn btn-sm btn-warning" onclick="location.href='<?php echo $urlLogin; ?>'"
type="button"><?php echo Text::_('COM_JEM_LOGIN_FOR_REGISTER'); ?></button>
<?php //insert Breezing Form hack here
/*<input class="btn btn-secondary" type="button" value="<?php echo Text::_('COM_JEM_SIGNUPHERE_AS_GUEST'); ?>" onClick="window.location='/index.php?option=com_breezingforms&view=form&Itemid=6089&event=<?php echo $this->item->title; ?>&date=<?php echo $this->item->dates ?>&conemail=<?php echo $this->item->conemail ?>';"/>
*/?>
<?php
break;
case 3:
if($this->item->reginvitedonly == 1){
if($this->isregistered === 0){
echo $this->loadTemplate('regform');
} else{
echo Text::_('COM_JEM_INVITED_USERS_ONLY') . '.<br>' . Text::_('COM_JEM_NOT_INVITED') . '.';
}
}
break;
case 4:
case 5:
echo $this->loadTemplate('regform');
break;
}
}
?>
</dd>
</dl>
<?php endif; ?>
</div>

View File

@ -0,0 +1,349 @@
<?php
/**
* @package JEM
* @copyright (C) 2013-2024 joomlaeventmanager.net
* @copyright (C) 2005-2009 Christoph Lukes
* @license https://www.gnu.org/licenses/gpl-3.0 GNU/GPL
*/
defined('_JEXEC') or die;
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Router\Route;
// The user is not already attending -> display registration form.
if ($this->showRegForm && empty($this->print)) :
if (($this->item->maxplaces > 0) && (($this->item->booked + $this->item->reservedplaces) >= $this->item->maxplaces) && !$this->item->waitinglist && empty($this->registration->status)) :
?>
<?php echo Text::_( 'COM_JEM_EVENT_FULL_NOTICE' ); ?>
<?php else :
//USER
$waitingPlacesUser = 0;
$placesBookedUser = 0;
$placesRegisteredUser = 0;
$statusRegistrationUser = -1;
$model = $this->getModel('event');
if ($this->item->maxbookeduser != 0) {
$placesavailableuser = $this->item->maxbookeduser;
if ($this->registereduser !== null) {
$placesavailableuser = $this->item->maxbookeduser - ($this->registers[$this->registereduser]->status > 0 ? $this->registers[$this->registereduser]->places : 0);
} else if ($this->item->waitinglist && $this->registration != null) {
if ($this->registration->status == 2) {
$placesavailableuser = $this->item->maxbookeduser - $this->registration->places;
$waitingPlacesUser = $this->registration->places;
$statusRegistrationUser = $this->registration->status;
}
}
} else {
$placesavailableuser = null;
}
//EVENT
if ($this->item->maxplaces) {
$placesavailableevent = $this->item->maxplaces - $this->item->booked - $this->item->reservedplaces;
if ($placesavailableuser === null) {
$placesavailableuser = $placesavailableevent;
}
} else {
$placesavailableevent = false;
}
if ($placesavailableevent != false) {
if ($placesavailableuser > 0 && ($placesavailableuser > $placesavailableevent)) {
$placesavailableuser = $placesavailableevent;
}
}
//BOOKED PLACES BY USER
if ($this->registereduser !== null) {
$statusRegistrationUser = $this->registers[$this->registereduser]->status;
if ($statusRegistrationUser == 1) {
$placesBookedUser = $this->registers[$this->registereduser]->places;
} else {
$placesBookedUser = 0;
}
$placesRegisteredUser = $this->registers[$this->registereduser]->places;
}
?>
<form id="JEM" action="<?php echo Route::_('index.php?option=com_jem&view=event&id=' . (int)$this->item->id); ?>" name="adminForm" id="adminForm" method="post">
<p>
<?php
if ($this->isregistered === false) {
if ($this->item->requestanswer) {
echo Text::_('COM_JEM_SEND_UNREGISTRATION');
}
if ($this->item->registra == 3) {
echo Text::_('COM_JEM_NOT_INVITED');
} else {
echo Text::_('COM_JEM_YOU_ARE_UNREGISTERED');
}
} else {
switch ($this->isregistered) :
case -1:
//You are NOT attending
echo Text::_('COM_JEM_YOU_ARE_NOT_ATTENDING');
break;
case 0:
//You're invited
echo Text::_('COM_JEM_YOU_ARE_INVITED');
break;
case 1:
//You're attending
if ($this->allowAnnulation) {
echo Text::_('COM_JEM_YOU_ARE_ATTENDING');
} else {
echo substr(Text::_('COM_JEM_YOU_ARE_ATTENDING'), 0,strpos(Text::_('COM_JEM_YOU_ARE_ATTENDING'), "<br>"));
}
break;
case 2:
//You're on Waitinglist
echo Text::_('COM_JEM_YOU_ARE_ON_WAITINGLIST');
break;
default:
//You didn't answer!
echo Text::_('COM_JEM_YOU_ARE_UNREGISTERED');
break;
endswitch;
}
if ($this->item->seriesbooking) {
// If event has 'seriesbooking' active and $checkseries is true then get all recurrence events of series from now (register or unregister)
$events = $model->getListRecurrenceEventsbyId($this->item->id, $this->item->recurrence_first_id, time(), $this->user->id);
if ($events) {
// Shown the active series event list
echo '<div class="pt-3">' . Text::_('COM_JEM_I_WILL_NOT_GO_SERIES_4') . '</div>';
echo '<div><table id="table-series"><thead><tr><th>' . Text::_('COM_JEM_DATE') . '</th><th>' . Text::_('COM_JEM_TITLE') . '</th><th>' . Text::_('COM_JEM_STATUS') . '</th><th>' . Text::_('COM_JEM_PLACES') . '</th><th>ID</th></tr></thead><tbody>';
foreach ($events as $e) {
if (!$e->waiting && $e->status == 1) {
$status = Text::_('COM_JEM_ATTENDEES_ATTENDING');
} else if ($e->waiting == 1 && $e->status == 1) {
$status = Text::_('COM_JEM_ATTENDEES_ON_WAITINGLIST');
} else if (!$e->status){
$status = Text::_('COM_JEM_ATTENDEES_INVITED');
} else if ($e->status == -1) {
$status = Text::_('COM_JEM_ATTENDEES_NOT_ATTENDING');
} else {
$status = Text::_('COM_JEM_ATTENDEES_STATUS_UNKNOWN');
}
echo '<tr><td nowrap>' . $e->dates . ' [' . ($e->times ? substr($e->times, 0, 5) : '') . ($e->endtimes ? '-' . substr($e->endtimes, 0, 5) : '') . ']</td><td>' . $e->title . '</td><td>' . $status . '</td><td>' . $e->places . '</td><td>' . $e->id . '</td></tr>';
}
echo '</tbody></table></div>';
echo '<div>&nbsp;</div>';
}
}
?>
</p>
<p>
<input type="radio" name="reg_check" value="1" onclick="check(this, document.getElementById('jem_send_attend'))"
<?php if ($this->isregistered !== false
&& ($placesavailableevent === 0 || ($placesavailableuser === 0 && $statusRegistrationUser != 0))
&& (!$this->item->waitinglist || ($this->item->waitinglist && ($placesBookedUser || $placesavailableuser === 0)))
|| !$this->allowRegistration) {
echo 'disabled="disabled"';
} else {
echo 'checked="checked"';
} ?>
/>
<i class="fa fa-check-circle-o fa-lg jem-registerbutton" aria-hidden="true"></i>
<?php
//FULL AND WAITLIST
if ($this->item->maxplaces && (($this->item->booked + $this->item->reservedplaces) >= $this->item->maxplaces)) {
if ($this->item->waitinglist) {
if ($placesBookedUser) {
$placesavailableuser = 0;
echo Text::_('COM_JEM_EVENT_FULL_USER_REGISTERED_NO_WAITING_LIST');
} else {
echo Text::_('COM_JEM_EVENT_FULL_REGISTER_TO_WAITING_LIST');
}
} else {
if ($placesavailableevent === 0) {
echo Text::_('COM_JEM_NOT_AVAILABLE_PLACES_EVENT');
$placesavailableuser = 0;
}
}
} else {
//Option: I will attend
if ($this->registereduser !== null) {
if (!$placesBookedUser) {
echo Text::_('COM_JEM_I_WILL_GO');
}
} else {
echo Text::_('COM_JEM_I_WILL_GO');
if(!$this->allowRegistration){
echo '<span class="badge bg-warning text-light" role="alert">' . Text::_('COM_JEM_EVENT_REGISTRATION_CLOSED') . '</span>';
}
}
}
// for this user no additional places
if ($placesavailableuser === 0 || $this->registration === false) {
echo '<span class="badge bg-warning text-light" role="alert">' . Text::_('COM_JEM_NOT_AVAILABLE_PLACES_USER') . '</span>';
} else {
// Booking places
if ($this->item->maxbookeduser > 1) {
echo ' ' . Text::_('COM_JEM_I_WILL_GO_2');
echo ' <input id="addplaces" style="text-align: center; width:auto;" type="number" name="addplaces" '
. 'value="' . ($placesavailableuser > 0 ? ($this->item->maxbookeduser - $placesBookedUser < $placesavailableuser ? $this->item->minbookeduser - $placesBookedUser : 1) : ($placesavailableuser ?? 1))
. '" max="' . ($placesavailableuser > 0 ? ($this->item->maxbookeduser - $placesBookedUser < $placesavailableuser ? $this->item->maxbookeduser - $placesBookedUser : $placesavailableuser) : ($placesavailableuser ?? ''))
. '" min="' . ($placesavailableuser > 0 ? ($placesBookedUser - $this->item->minbookeduser >= 0 ? 1 : $this->item->minbookeduser - $placesBookedUser) : 0) . '">';
if ($this->registereduser != null) {
//Places
if ($placesBookedUser && $statusRegistrationUser == 1) {
echo ' ' . Text::_('COM_JEM_I_WILL_GO_3');
} else {
//Place
echo ' ' . Text::_('COM_JEM_PLACES_REG') . '.';
}
} else {
//Place
if ($this->item->maxbookeduser == $placesavailableuser) {
echo ' ' . Text::_('COM_JEM_PLACES_REG') . '.';
} else {
//Places
echo ' ' . Text::_('COM_JEM_I_WILL_GO_3');
}
}
} else {
echo ' <input id="addplaces" style="text-align: center; width:auto;" type="hidden" name="addplaces" value="1">';
}
if ($this->item->recurrence_type){
echo '<div class="p-3" >' . Text::_('COM_JEM_I_WILL_GO_SERIES_1') . '</div>';
if ($this->item->seriesbooking) {
// If event has 'seriesbooking' active and $checkseries is true then get all recurrence events of series from now (register or unregister)
if (!$this->registereduser){
$events = $model->getListRecurrenceEventsbyId($this->item->id, $this->item->recurrence_first_id, time());
}else{
$events = $model->getListRecurrenceEventsbyId($this->item->id, $this->item->recurrence_first_id, time(), $this->user->id, 1);
}
if($events) {
// Shown the active series event list
echo '<div class="px-3">' . Text::_('COM_JEM_I_WILL_GO_SERIES_4') . '</div>';
echo '<div class="px-3"><table id="table-series"><thead><tr><th>' . Text::_('COM_JEM_DATE') . '</th><th>' . Text::_('COM_JEM_TITLE') . '</th>' . ($this->registereduser? '<th>' . Text::_('COM_JEM_STATUS') . '</th><th>' . Text::_('COM_JEM_PLACES') . '</th>':'') . '<th>ID</th></tr></thead><tbody>';
foreach ($events as $e) {
if ($this->registereduser) {
switch ($e->status) {
case -1:
$status = Text::_('COM_JEM_ATTENDEES_NOT_ATTENDING');
break;
case 0:
$status = Text::_('COM_JEM_ATTENDEES_INVITED');
break;
case 1:
if ($e->waiting) {
$status = Text::_('COM_JEM_ATTENDEES_ON_WAITINGLIST');
} else {
$status = Text::_('COM_JEM_ATTENDEES_ATTENDING');
}
break;
default:
$status = Text::_('COM_JEM_ATTENDEES_STATUS_UNKNOWN');
break;
}
}
echo '<tr><td nowrap>' . $e->dates . ' [' . ($e->times ? substr($e->times, 0, 5) : '') . ($e->endtimes ? '-' . substr($e->endtimes, 0, 5) : '') . ']</td><td>' . $e->title . '</td>' . ($this->registereduser? '<td>' . $status . '</td><td>' . $e->places . '</td>':'') . '<td>' . $e->id . '</td></tr>';
}
echo '</tbody></table></div>';
if ($this->item->singlebooking) {
echo '<div class="px-3 pt-3"> <input id = "jem_unregister_event_series" type = "checkbox" name = "reg_check_series"> ' . Text::_('COM_JEM_I_WILL_GO_SERIES_2') . '</input ></div>';
} else {
echo '<div class="px-3 pt-3">' . Text::_('COM_JEM_I_WILL_GO_SERIES_3') . '</div>';
}
}
}
}
}
?>
</p>
<?php if ($this->item->requestanswer || $placesRegisteredUser || $waitingPlacesUser) {?>
<p>
<?php if ($this->allowAnnulation || ($this->isregistered != 1) || $waitingPlacesUser) : ?>
<input id="jem_unregister_event" type="radio" name="reg_check" value="-1" onclick="check(this, document.getElementById('jem_send_attend'));"
<?php if ($this->isregistered !== false && $statusRegistrationUser>0 && $placesavailableuser==0) { echo 'checked="checked"'; } ?>
/>
<i class="fa fa-times-circle-o fa-lg jem-unregisterbutton" aria-hidden="true"></i>
<?php
//Option: I don't attend
echo ' ' . Text::_('COM_JEM_I_WILL_NOT_GO');
if ($this->registereduser !== null || $waitingPlacesUser) {
if ($placesRegisteredUser || $waitingPlacesUser) {
if ($statusRegistrationUser == 1) {
// Booked places
$cancelplaces = ($placesRegisteredUser - 1 > 1 ? Text::_('COM_JEM_BOOKED_PLACES') : Text::_('COM_JEM_BOOKED_PLACE'));
} else if ($statusRegistrationUser == -1) {
$cancelplaces = '';
//Booked places for invited users
} else if ($statusRegistrationUser == 0) {
$cancelplaces = ($placesRegisteredUser - 1 > 1 ? Text::_('COM_JEM_INVITED_PLACES') : Text::_('COM_JEM_INVITED_PLACE'));
//Booked places for waiting users
} else if ($statusRegistrationUser == 2) {
$cancelplaces = ($waitingPlacesUser - 1 > 1 ? Text::_('COM_JEM_WAITING_PLACES') : Text::_('COM_JEM_WAITING_PLACE'));
}
//Canceling...
echo ' ' . Text::_('COM_JEM_I_WILL_NOT_GO_2');
echo ' <input id="cancelplaces" style="text-align: center;" type="number" name="cancelplaces" value="' . ($placesRegisteredUser ? $placesRegisteredUser : $waitingPlacesUser) . '" max="' . ($placesRegisteredUser ? $placesRegisteredUser : $waitingPlacesUser) . '" min="1">' . ' ' . $cancelplaces;
}
if ($this->item->recurrence_type) {
echo '<div class="px-3">' . Text::_('COM_JEM_I_WILL_NOT_GO_SERIES_1') . '</div>';
if ($this->item->seriesbooking) {
if($events) {
if ($this->item->singlebooking) {
echo '<div class="px-3 pt-3"> <input id = "jem_unregister_event_series" type = "checkbox" name = "reg_check_series"> ' . Text::_('COM_JEM_I_WILL_NOT_GO_SERIES_2') . '</input ></div>';
} else {
echo '<div class="px-3">' . Text::_('COM_JEM_I_WILL_NOT_GO_SERIES_3') . '</div>';
}
}else{
echo '<div class="px-3">' . Text::_('COM_JEM_I_WILL_NOT_GO_SERIES_5') . '</div>';
}
}
}
} else {
//...booked places
$cancelplaces = Text::_('COM_JEM_I_WILL_NOT_GO_3');
}
?>
<?php else :
//Unregistration is not possible?>
<input type="radio" name="reg_dummy" value="" disabled="disabled" />
<i class="fa fa-times-circle-o fa-lg jem-unregisterbutton" aria-hidden="true"></i>
<?php echo ' '.Text::_('COM_JEM_NOT_ALLOWED_TO_ANNULATE'); ?>
<?php endif; ?>
</p>
<?php }
$disabledOptions = ($placesavailableuser && !$this->allowRegistration) || (!$placesavailableuser && $this->allowRegistration && !$this->allowAnnulation) || (!$this->allowAnnulation && !$this->allowRegistration);
//Comment?>
<?php if (!empty($this->jemsettings->regallowcomments)) { ?>
<p><?php echo Text::_('COM_JEM_OPTIONAL_COMMENT') . ':'; ?></p>
<p><textarea class="inputbox" name="reg_comment" id="reg_comment" rows="3" cols="30" maxlength="255" <?php echo ($disabledOptions ? 'disabled="disabled"':'');?>><?php
if (is_object($this->registration) && !empty($this->registration->comment)) {
echo htmlspecialchars($this->registration->comment);
} ?></textarea></p>
<?php } ?>
<p>
<input class="btn btn-sm btn-primary" type="submit" id="jem_send_attend" name="jem_send_attend"
<?php echo ($disabledOptions? 'disabled="disabled"':'');?>
value="<?php echo ($placesRegisteredUser ? Text::_('COM_JEM_SEND_REGISTER') : Text::_('COM_JEM_REGISTER')); ?>" />
</p>
<input type="hidden" name="rdid" value="<?php echo $this->item->did; ?>" />
<input type="hidden" name="regid" value="<?php echo (is_object($this->registration) ? $this->registration->id : 0); ?>" />
<input type="hidden" name="task" value="event.userregister"/>
<?php echo HTMLHelper::_('form.token'); ?>
</form>
<?php
endif; // full?
endif; // registra and not print

View File

@ -0,0 +1 @@
<!DOCTYPE html><title></title>

View File

@ -0,0 +1,552 @@
<?php
/**
* @package JEM
* @copyright (C) 2013-2024 joomlaeventmanager.net
* @copyright (C) 2005-2009 Christoph Lukes
* @license https://www.gnu.org/licenses/gpl-3.0 GNU/GPL
*/
defined('_JEXEC') or die;
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Factory;
use Joomla\CMS\Uri\Uri;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Date\Date;
HTMLHelper::addIncludePath(JPATH_COMPONENT . '/helpers');
// Create shortcuts to some parameters.
$params = $this->item->params;
$images = json_decode($this->item->datimage);
$attribs = json_decode($this->item->attribs);
$user = JemFactory::getUser();
$jemsettings = JemHelper::config();
$app = Factory::getApplication();
$document = $app->getDocument();
$uri = Uri::getInstance();
// Add expiration date, if old events will be archived or removed
if ($jemsettings->oldevent > 0) {
$enddate = strtotime($this->item->enddates?:($this->item->dates?:date("Y-m-d")));
$expDate = date("D, d M Y H:i:s", strtotime('+1 day', $enddate));
$document->addCustomTag('<meta http-equiv="expires" content="' . $expDate . '"/>');
}
$catclasses = '';
foreach ((array)$this->categories as $category) {
$catclasses .= ' cat_id' . $this->escape($category->id);
}
if ($params->get('access-view')) { /* This will show nothings otherwise - ??? */ ?>
<div id="jem" class="event_id<?php
echo $this->escape($this->item->did);
if (!empty($this->item->locid)) {
echo ' venue_id' . $this->escape($this->item->locid);
}
if (!empty($catclasses)) {
echo $this->escape($catclasses);
}
?> jem_event<?php echo $this->escape($this->pageclass_sfx); ?>"
itemscope="itemscope" itemtype="https://schema.org/Event">
<meta itemprop="url" content="<?php echo rtrim($uri->base(), '/').Route::_(JemHelperRoute::getEventRoute($this->item->slug)); ?>" />
<meta itemprop="identifier" content="<?php echo rtrim($uri->base(), '/').Route::_(JemHelperRoute::getEventRoute($this->item->slug)); ?>" />
<div class="buttons">
<?php
$btn_params = array('slug' => $this->item->slug, 'print_link' => $this->print_link);
echo JemOutput::createButtonBar($this->getName(), $this->permissions, $btn_params);
?>
</div>
<?php if ($this->params->get('show_page_heading', 1)) : ?>
<h1 class="componentheading">
<?php echo $this->escape($this->params->get('page_heading')); ?>
</h1>
<?php endif; ?>
<!-- Event -->
<h2 class="jem">
<?php
echo Text::_('COM_JEM_EVENT') . JemOutput::recurrenceicon($this->item) . ' ';
if($this->item_root) {
echo JemOutput::editbutton($this->item_root, $params, $attribs, $this->permissions->canEditEvent, 'editevent') . ' ';
}
if(!$this->item_root || ($this->item_root && $this->item->recurrence_first_id)) {
echo JemOutput::editbutton($this->item, $params, $attribs, $this->permissions->canEditEvent, 'editevent') .' ';
}
echo JemOutput::copybutton($this->item, $params, $attribs, $this->permissions->canAddEvent, 'editevent');
?>
</h2>
<div class="jem-row">
<div class="jem-info">
<dl class="jem-dl">
<?php if ($params->get('event_show_detailstitle',1)) : ?>
<dt class="jem-title hasTooltip" data-original-title="<?php echo Text::_('COM_JEM_TITLE'); ?>"><?php echo Text::_('COM_JEM_TITLE'); ?>:</dt>
<dd class="jem-title" itemprop="name"><?php echo $this->escape($this->item->title); ?></dd>
<?php
endif;
?>
<dt class="jem-when hasTooltip" data-original-title="<?php echo Text::_('COM_JEM_WHEN'); ?>"><?php echo Text::_('COM_JEM_WHEN'); ?>:</dt>
<dd class="jem-when">
<span style="white-space: nowrap;">
<?php
echo JemOutput::formatLongDateTime($this->item->dates, $this->item->times,$this->item->enddates, $this->item->endtimes);
echo JemOutput::formatSchemaOrgDateTime($this->item->dates, $this->item->times,$this->item->enddates, $this->item->endtimes);
?>
</span>
</dd>
<?php if (!empty($this->item->locid)) : ?>
<dt class="jem-where hasTooltip" data-original-title="<?php echo Text::_('COM_JEM_WHERE'); ?>"><?php echo Text::_('COM_JEM_WHERE'); ?>:</dt>
<dd class="jem-where"><?php
if (($params->get('event_show_detlinkvenue') == 1) && (!empty($this->item->url))) :
?><a target="_blank" href="<?php echo $this->item->url; ?>"><?php echo $this->escape($this->item->venue); ?></a><?php
elseif (($params->get('event_show_detlinkvenue') == 2) && (!empty($this->item->venueslug))) :
?><a href="<?php echo Route::_(JemHelperRoute::getVenueRoute($this->item->venueslug)); ?>"><?php echo $this->item->venue; ?></a><?php
else/*if ($params->get('event_show_detlinkvenue') == 0)*/ :
echo $this->escape($this->item->venue);
endif;
# will show "venue" or "venue - city" or "venue - city, state" or "venue, state"
$city = $this->escape($this->item->city);
$state = $this->escape($this->item->state);
if ($city) { echo ' - ' . $city; }
if ($state) { echo ', ' . $state; }
?>
</dd>
<?php
endif;
$n = is_array($this->categories) ? count($this->categories) : 0;
?>
<dt class="jem-category hasTooltip" data-original-title="<?php echo $n < 2 ? Text::_('COM_JEM_CATEGORY') : Text::_('COM_JEM_CATEGORIES'); ?>">
<?php echo $n < 2 ? Text::_('COM_JEM_CATEGORY') : Text::_('COM_JEM_CATEGORIES'); ?>:
</dt>
<dd class="jem-category">
<?php
$i = 0;
foreach ((array)$this->categories as $category) :
?><a href="<?php echo Route::_(JemHelperRoute::getCategoryRoute($category->catslug)); ?>"><?php echo $this->escape($category->catname); ?></a><?php
$i++;
if ($i != $n) :
echo ', ';
endif;
endforeach;
?>
</dd>
<?php
for ($cr = 1; $cr <= 10; $cr++) {
$currentRow = $this->item->{'custom'.$cr};
if (preg_match('%^http(s)?://%', $currentRow)) {
$currentRow = '<a href="'.$this->escape($currentRow).'" target="_blank">'.$this->escape($currentRow).'</a>';
}
if ($currentRow) {
?>
<dt class="jem-custom<?php echo $cr; ?> hasTooltip" data-original-title="<?php echo Text::_('COM_JEM_EVENT_CUSTOM_FIELD'.$cr); ?>"><?php echo Text::_('COM_JEM_EVENT_CUSTOM_FIELD'.$cr); ?>:</dt>
<dd class="jem-custom<?php echo $cr; ?>"><?php echo $currentRow; ?></dd>
<?php
}
}
?>
<?php if ($params->get('event_show_hits')) : ?>
<dt class="jem-hits hasTooltip" data-original-title="<?php echo Text::_('COM_JEM_EVENT_HITS_LABEL'); ?>"><?php echo Text::_('COM_JEM_EVENT_HITS_LABEL'); ?>:</dt>
<dd class="jem-hits"><?php echo Text::sprintf('COM_JEM_EVENT_HITS', $this->item->hits); ?></dd>
<?php endif; ?>
<!-- AUTHOR -->
<?php if ($params->get('event_show_author') && !empty($this->item->author)) : ?>
<dt class="createdby hasTooltip" data-original-title="<?php echo Text::_('COM_JEM_EVENT_CREATED_BY_LABEL'); ?>"><?php echo Text::_('COM_JEM_EVENT_CREATED_BY_LABEL'); ?>:</dt>
<dd class="createdby">
<?php $author = $this->item->created_by_alias ? $this->item->created_by_alias : $this->item->author; ?>
<?php if (!empty($this->item->contactid2) && $params->get('event_link_author') == true) :
$needle = 'index.php?option=com_contact&view=contact&id=' . $this->item->contactid2 . '&catid=' . $this->item->concatid;
$menu = Factory::getApplication()->getMenu();
$item = $menu->getItems('link', $needle, true);
$cntlink = !empty($item) ? $needle . '&Itemid=' . $item->id : $needle;
echo Text::sprintf('COM_JEM_EVENT_CREATED_BY', HTMLHelper::_('link', Route::_($cntlink), $author));
else :
echo Text::sprintf('COM_JEM_EVENT_CREATED_BY', $author);
endif;
?>
</dd>
<?php endif; ?>
<!-- PUBLISHING STATE -->
<?php if (!empty($this->showeventstate) && isset($this->item->published)) : ?>
<dt class="jem-published hasTooltip" data-original-title="<?php echo Text::_('JSTATUS'); ?>"><?php echo Text::_('JSTATUS'); ?>:</dt>
<dd class="jem-published">
<?php switch ($this->item->published) {
case 1: echo Text::_('JPUBLISHED'); break;
case 0: echo Text::_('JUNPUBLISHED'); break;
case 2: echo Text::_('JARCHIVED'); break;
case -2: echo Text::_('JTRASHED'); break;
} ?>
</dd>
<?php endif; ?>
</dl>
</div>
<style>
.jem-img {
flex-basis: <?php echo $this->jemsettings->imagewidth; ?>px;
}
</style>
<div class="jem-img">
<?php echo JemOutput::flyer($this->item, $this->dimage, 'event'); ?>
</div>
</div>
<!-- DESCRIPTION -->
<?php if ($params->get('event_show_description','1') && ($this->item->fulltext != '' && $this->item->fulltext != '<br />' || $this->item->introtext != '' && $this->item->introtext != '<br />')) { ?>
<h2 class="jem-description"><?php echo Text::_('COM_JEM_EVENT_DESCRIPTION'); ?></h2>
<div class="jem-description event_desc" itemprop="description">
<?php
if ($params->get('access-view')) {
echo $this->item->text;
}
/* optional teaser intro text for guests - NOT SUPPORTED YET */
elseif (0 /*$params->get('event_show_noauth') == true and $user->get('guest')*/ ) {
echo $this->item->introtext;
// Optional link to let them register to see the whole event.
if ($params->get('event_show_readmore') && $this->item->fulltext != null) {
$link1 = Route::_('index.php?option=com_users&view=login');
$link = new Uri($link1);
echo '<p class="readmore">';
echo '<a href="'.$link.'">';
if ($params->get('event_alternative_readmore') == false) {
echo Text::_('COM_JEM_EVENT_REGISTER_TO_READ_MORE');
} elseif ($readmore = $params->get('alternative_readmore')) {
echo $readmore;
}
if ($params->get('event_show_readmore_title', 0) != 0) {
echo HTMLHelper::_('string.truncate', ($this->item->title), $params->get('event_readmore_limit'));
} elseif ($params->get('event_show_readmore_title', 0) == 0) {
} else {
echo HTMLHelper::_('string.truncate', ($this->item->title), $params->get('event_readmore_limit'));
} ?>
</a>
</p>
<?php
}
} /* access_view / show_noauth */
?>
</div>
<?php } ?>
<!-- Contact -->
<?php if ($params->get('event_show_contact') && !empty($this->item->conid )) : ?>
<h2 class="jem-contact"><?php echo Text::_('COM_JEM_CONTACT') ; ?></h2>
<dl class="jem-dl">
<dt class="con_name hasTooltip" data-original-title="<?php echo Text::_('COM_JEM_NAME'); ?>"><?php echo Text::_('COM_JEM_NAME'); ?>:</dt>
<dd class="con_name">
<?php
$contact = $this->item->conname;
if ($params->get('event_link_contact') == true) :
$needle = 'index.php?option=com_contact&view=contact&id=' . $this->item->conid . '&catid=' . $this->item->concatid;
$menu = Factory::getApplication()->getMenu();
$item = $menu->getItems('link', $needle, true);
$cntlink2 = !empty($item) ? $needle . '&Itemid=' . $item->id : $needle;
echo Text::sprintf('COM_JEM_EVENT_CONTACT', HTMLHelper::_('link', Route::_($cntlink2), $contact));
else :
echo Text::sprintf('COM_JEM_EVENT_CONTACT', $contact);
endif;
?>
</dd>
<?php if ($this->item->contelephone) : ?>
<dt class="con_telephone hasTooltip" data-original-title="<?php echo Text::_('COM_JEM_TELEPHONE'); ?>"><?php echo Text::_('COM_JEM_TELEPHONE'); ?>:</dt>
<dd class="con_telephone">
<?php echo $this->escape($this->item->contelephone); ?>
</dd>
<?php endif; ?>
</dl>
<?php endif ?>
<?php $this->attachments = $this->item->attachments; ?>
<?php echo $this->loadTemplate('attachments'); ?>
<!-- Venue -->
<?php if ((!empty($this->item->locid)) && !empty($this->item->venue) && $params->get('event_show_venue', '1')) : ?>
<p></p>
<hr class="jem-hr">
<div class="venue_id<?php echo $this->item->locid; ?>" itemprop="location" itemscope="itemscope" itemtype="https://schema.org/Place">
<meta itemprop="name" content="<?php echo $this->escape($this->item->venue); ?>" />
<?php $itemid = $this->item ? $this->item->id : 0 ; ?>
<h2 class="jem-location">
<?php
echo Text::_('COM_JEM_VENUE').' '.JemOutput::editbutton($this->item, $params, $attribs, $this->permissions->canEditVenue, 'editvenue').' '.JemOutput::copybutton($this->item, $params, $attribs, $this->permissions->canAddVenue, 'editvenue');
?>
</h2>
<div class="jem-row jem-wrap-reverse">
<?php if ($params->get('event_show_detailsadress', '1')) : ?>
<div class="jem-grow-2">
<dl class="jem-dl" itemprop="address" itemscope
itemtype="https://schema.org/PostalAddress">
<dt class="venue hasTooltip" data-original-title="<?php echo Text::_('COM_JEM_LOCATION'); ?>"><?php echo Text::_('COM_JEM_LOCATION'); ?>:</dt>
<dd class="venue">
<?php
if (($params->get('event_show_detlinkvenue') == 1) && (!empty($this->item->url))) :
echo '<a target="_blank" href="' . $this->item->url . '">' . $this->escape($this->item->venue) . '</a>';
elseif (($params->get('event_show_detlinkvenue') == 2) && (!empty($this->item->venueslug))) :
echo '<a href="' . Route::_(JemHelperRoute::getVenueRoute($this->item->venueslug)) . '">' . $this->escape($this->item->venue) . '</a>';
else/*if ($params->get('event_show_detlinkvenue') == 0)*/ :
echo $this->escape($this->item->venue);
endif;
?>
</dd>
<?php if ($this->item->street) : ?>
<dt class="venue_street hasTooltip" data-original-title="<?php echo Text::_('COM_JEM_STREET'); ?>"><?php echo Text::_('COM_JEM_STREET'); ?>:</dt>
<dd class="venue_street" itemprop="streetAddress">
<?php echo $this->escape($this->item->street); ?>
</dd>
<?php endif; ?>
<?php if ($this->item->postalCode) : ?>
<dt class="venue_postalCode hasTooltip" data-original-title="<?php echo Text::_('COM_JEM_ZIP'); ?>"><?php echo Text::_('COM_JEM_ZIP'); ?>:</dt>
<dd class="venue_postalCode" itemprop="postalCode">
<?php echo $this->escape($this->item->postalCode); ?>
</dd>
<?php endif; ?>
<?php if ($this->item->city) : ?>
<dt class="venue_city hasTooltip" data-original-title="<?php echo Text::_('COM_JEM_CITY'); ?>"><?php echo Text::_('COM_JEM_CITY'); ?>:</dt>
<dd class="venue_city" itemprop="addressLocality">
<?php echo $this->escape($this->item->city); ?>
</dd>
<?php endif; ?>
<?php if ($this->item->state) : ?>
<dt class="venue_state hasTooltip" data-original-title="<?php echo Text::_('COM_JEM_STATE'); ?>"><?php echo Text::_('COM_JEM_STATE'); ?>:</dt>
<dd class="venue_state" itemprop="addressRegion">
<?php echo $this->escape($this->item->state); ?>
</dd>
<?php endif; ?>
<?php if ($this->item->country) : ?>
<dt class="venue_country hasTooltip" data-original-title="<?php echo Text::_('COM_JEM_COUNTRY'); ?>"><?php echo Text::_('COM_JEM_COUNTRY'); ?>:</dt>
<dd class="venue_country">
<?php echo $this->item->countryimg ? $this->item->countryimg : $this->item->country; ?>
<meta itemprop="addressCountry" content="<?php echo $this->item->country; ?>" />
</dd>
<?php endif; ?>
<!-- PUBLISHING STATE -->
<?php if (!empty($this->showvenuestate) && isset($this->item->locpublished)) : ?>
<dt class="venue_published hasTooltip" data-original-title="<?php echo Text::_('JSTATUS'); ?>"><?php echo Text::_('JSTATUS'); ?>:</dt>
<dd class="venue_published">
<?php switch ($this->item->locpublished) {
case 1: echo Text::_('JPUBLISHED'); break;
case 0: echo Text::_('JUNPUBLISHED'); break;
case 2: echo Text::_('JARCHIVED'); break;
case -2: echo Text::_('JTRASHED'); break;
} ?>
</dd>
<?php endif; ?>
<?php
for ($cr = 1; $cr <= 10; $cr++) {
$currentRow = $this->item->{'venue'.$cr};
if (preg_match('%^http(s)?://%', $currentRow)) {
$currentRow = '<a href="' . $this->escape($currentRow) . '" target="_blank">' . $this->escape($currentRow) . '</a>';
}
if ($currentRow) {
?>
<dt class="custom<?php echo $cr; ?> hasTooltip" data-original-title="<?php echo Text::_('COM_JEM_VENUE_CUSTOM_FIELD'.$cr); ?>"><?php echo Text::_('COM_JEM_VENUE_CUSTOM_FIELD'.$cr); ?>:</dt>
<dd class="custom<?php echo $cr; ?>"><?php echo $currentRow; ?></dd>
<?php
}
}
?>
<?php if ($params->get('event_show_mapserv') == 1 || $params->get('event_show_mapserv') == 4) : ?>
<?php echo JemOutput::mapicon($this->item, 'event', $params); ?>
<?php endif; ?>
</dl>
</div>
<div class="jem-img">
<?php echo JemOutput::flyer($this->item, $this->limage, 'venue'); ?>
</div>
<?php else : // $params->get('event_show_detailsadress', '1') == 0 ?>
<div class="jem-grow-2">
<dl class="jem-dl" itemprop="address" itemscope
itemtype="https://schema.org/PostalAddress">
<dt class="venue hasTooltip" data-original-title="<?php echo Text::_('COM_JEM_LOCATION'); ?>"><?php echo Text::_('COM_JEM_LOCATION'); ?>:</dt>
<dd class="venue">
<?php
if (($params->get('event_show_detlinkvenue') == 1) && (!empty($this->item->url))) :
echo '<a target="_blank" href="' . $this->item->url . '">' . $this->escape($this->item->venue) . '</a>';
elseif (($params->get('event_show_detlinkvenue') == 2) && (!empty($this->item->venueslug))) :
echo '<a href="' . Route::_(JemHelperRoute::getVenueRoute($this->item->venueslug)) . '">' . $this->escape($this->item->venue) . '</a>';
else/*if ($params->get('event_show_detlinkvenue') == 0)*/ :
echo $this->escape($this->item->venue);
endif;
?>
</dd>
</dl>
</div>
<div class="jem-img">
<?php echo JemOutput::flyer($this->item, $this->limage, 'venue'); ?>
</div>
<?php endif; /* event_show_detailsadress */ ?>
</div>
<?php
$event_show_mapserv = $params->get('event_show_mapserv');
if ($params->get('event_show_mapserv') == 2 || $params->get('event_show_mapserv') == 5) : ?>
<div class="jem-map">
<?php echo JemOutput::mapicon($this->item, 'event', $params); ?>
</div>
<?php endif; ?>
<?php if ($event_show_mapserv == 3) : ?>
<div class="jem-map">
<input type="hidden" id="latitude" value="<?php echo $this->item->latitude; ?>">
<input type="hidden" id="longitude" value="<?php echo $this->item->longitude; ?>">
<input type="hidden" id="venue" value="<?php echo $this->item->venue; ?>">
<input type="hidden" id="street" value="<?php echo $this->item->street; ?>">
<input type="hidden" id="city" value="<?php echo $this->item->city; ?>">
<input type="hidden" id="state" value="<?php echo $this->item->state; ?>">
<input type="hidden" id="postalCode" value="<?php echo $this->item->postalCode; ?>">
<?php echo JemOutput::mapicon($this->item, 'event', $params); ?>
</div>
<?php endif; ?>
<?php if ($params->get('event_show_locdescription', '1') && $this->item->locdescription != ''
&& $this->item->locdescription != '<br />') : ?>
<h2 class="location_desc"><?php echo Text::_('COM_JEM_VENUE_DESCRIPTION'); ?></h2>
<div class="description location_desc" itemprop="description">
<?php echo $this->item->locdescription; ?>
</div>
<?php endif; ?>
<?php $this->attachments = $this->item->vattachments; ?>
<?php echo $this->loadTemplate('attachments'); ?>
</div>
<?php elseif (empty($this->item->locid)) : ?>
<div itemtype="https://schema.org/Place" itemscope itemprop="location" style="display: none;">
<meta itemprop="name" content="None"/>
</div>
<?php else : ?>
<div itemtype="https://schema.org/Place" itemscope itemprop="location" style="display: none;">
<meta itemprop="name" content="<?php echo $this->escape($this->item->venue); ?>" />
<div itemprop="address" itemscope itemtype="https://schema.org/PostalAddress" style="display: none;">
<?php if ($this->item->street) : ?>
<meta itemprop="streetAddress" content="<?php echo $this->escape($this->item->street); ?>">
<?php endif; ?>
<?php if ($this->item->postalCode) : ?>
<meta itemprop="postalCode" content="<?php echo $this->escape($this->item->postalCode); ?>">
<?php endif; ?>
<?php if ($this->item->city) : ?>
<meta itemprop="addressLocality" content="<?php echo $this->escape($this->item->city); ?>">
<?php endif; ?>
<?php if ($this->item->state) : ?>
<meta itemprop="addressRegion" content="<?php echo $this->escape($this->item->state); ?>">
<?php endif; ?>
<?php if ($this->item->country) : ?>
<meta itemprop="addressCountry" content="<?php echo $this->escape($this->item->country); ?>">
<?php endif; ?>
</div>
</div>
<?php endif; ?>
<!-- Registration -->
<?php if ($this->showAttendees && $params->get('event_show_registration', '1')) { ?>
<hr class="jem-hr">
<h2 class="register"><?php echo Text::_('COM_JEM_REGISTRATION'); ?></h2>
<dl class="jem-dl floattext">
<?php
$timeNow = time();
switch ($this->e_reg) {
case 0:
//Event without registration (NO)
echo Text::_('COM_JEM_VENUE_DESCRIPTION');
break;
case 1:
//Event with registration (YES with or witout UNTIL)
echo $this->loadTemplate('attendees');
if($this->dateUnregistationUntil) {
echo '<dt>' . ($this->allowAnnulation? Text::_('COM_JEM_EVENT_ANNULATION_NOTWILLBE_FROM') : Text::_('COM_JEM_EVENT_ANNULATION_ISNOT_FROM')) . '</dt><dd>' . HTMLHelper::_('date', $this->dateUnregistationUntil, Text::_('DATE_FORMAT_LC2')) . '</dd>';
}
break;
case 2:
//Event with date starting registration (FROM with or witout UNTIL)
if($this->dateRegistationFrom > $timeNow) {
echo '<dt>' . Text::_('COM_JEM_EVENT_REGISTRATION_WILLBE_FROM') . '</dt><dd>' . HTMLHelper::_('date', $this->dateRegistationFrom, Text::_('DATE_FORMAT_LC2'));
}else if ($this->allowRegistration) {
echo '<dt>' . Text::_('COM_JEM_EVENT_REGISTRATION_IS_FROM') . '</dt><dd>' . HTMLHelper::_('date', $this->dateRegistationFrom, Text::_('DATE_FORMAT_LC2'));
if($this->dateRegistationUntil){
echo " " . mb_strtolower(Text::_('COM_JEM_UNTIL')) . ' ' . HTMLHelper::_('date', $this->dateRegistationUntil, Text::_('DATE_FORMAT_LC2'));
}
echo "</dd>";
echo $this->loadTemplate('attendees');
//Event with date starting annulation
if($this->dateUnregistationUntil) {
echo '<dt>' . ($this->allowAnnulation? Text::_('COM_JEM_EVENT_ANNULATION_NOTWILLBE_FROM') : Text::_('COM_JEM_EVENT_ANNULATION_ISNOT_FROM')) . '</dt><dd>' . HTMLHelper::_('date', $this->dateUnregistationUntil, Text::_('DATE_FORMAT_LC2')) . '</dd>';
}
}else if($this->dateRegistationUntil !== false && $this->dateRegistationUntil < $timeNow) {
echo '<dt>' . Text::_('COM_JEM_EVENT_REGISTRATION_WAS_UNTIL') . '</dt><dd>' . HTMLHelper::_('date', $this->dateRegistationUntil, Text::_('DATE_FORMAT_LC2')) . '</dd>';
echo $this->loadTemplate('attendees');
//Event with date starting annulation
if($this->dateUnregistationUntil) {
echo '<dt>' . ($this->allowAnnulation? Text::_('COM_JEM_EVENT_ANNULATION_NOTWILLBE_FROM') : Text::_('COM_JEM_EVENT_ANNULATION_ISNOT_FROM')) . '</dt><dd>' . HTMLHelper::_('date', $this->dateUnregistationUntil, Text::_('DATE_FORMAT_LC2')) . '</dd>';
}
} else {
// open registration to the end of event
if($this->item->enddates){
$endDateEvent = strtotime($this->item->enddates . ' ' . ($this->item->endtimes ? $this->item->endtimes : '23:59:59'));
if($timeNow <= $endDateEvent){
echo '<dt>' . Text::_('COM_JEM_EVENT_REGISTRATION_IS_UNTIL');
} else {
echo '<dt>' . Text::_('COM_JEM_EVENT_REGISTRATION_WAS_UNTIL');
}
echo '</dt><dd>' . HTMLHelper::_('date', $endDateEvent, Text::_('DATE_FORMAT_LC2')) . '</dd>';
echo $this->loadTemplate('attendees');
}else{
if(!empty($this->item->dates)) {
$endDateEvent = strtotime($this->item->dates . ' ' . ($this->item->times ? $this->item->times : '23:59:59'));
if($timeNow <= $endDateEvent){
echo '<dt>' . Text::_('COM_JEM_EVENT_REGISTRATION_IS_UNTIL');
} else {
echo '<dt>' . Text::_('COM_JEM_EVENT_REGISTRATION_WAS_UNTIL');
}
echo '</dt><dd>' . HTMLHelper::_('date', $endDateEvent, Text::_('DATE_FORMAT_LC2')) . '</dd>';
echo $this->loadTemplate('attendees');
}
}
}
break;
} ?>
</dl>
<?php } ?>
<?php if (!empty($this->item->pluginevent->onEventEnd)) : ?>
<hr class="jem-hr">
<?php echo $this->item->pluginevent->onEventEnd; ?>
<?php endif; ?>
<div class="copyright">
<?php echo JemOutput::footer(); ?>
</div>
</div>
<?php }
echo JemOutput::lightbox();
?>

View File

@ -0,0 +1,277 @@
<?php
/**
* @package JEM
* @copyright (C) 2013-2024 joomlaeventmanager.net
* @copyright (C) 2005-2009 Christoph Lukes
* @license https://www.gnu.org/licenses/gpl-3.0 GNU/GPL
*
* @todo add check if CB does exists and if so perform action
*/
defined('_JEXEC') or die;
use Joomla\CMS\Filesystem\File;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Uri\Uri;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Factory;
$linkreg = 'index.php?option=com_jem&amp;view=attendees&amp;id='.$this->item->id.($this->itemid ? '&Itemid='.$this->itemid : '');
?>
<div class="register">
<dl class="jem-dl floattext">
<?php $maxplaces = (int)$this->item->maxplaces; ?>
<?php $reservedplaces = (int)$this->item->reservedplaces; ?>
<?php $minbookeduser = (int)$this->item->minbookeduser; ?>
<?php $maxbookeduser = (int)$this->item->maxbookeduser; ?>
<?php $booked = (int)$this->item->booked; ?>
<?php $waitinglist = (int)$this->item->waitinglist; ?>
<?php $seriesbooking = (int)$this->item->seriesbooking; ?>
<?php if($this->settings->get('event_show_registration_counters','1')) : ?>
<?php if ($maxplaces > 0) : ?>
<dt class="register max-places hasTooltip" data-original-title="<?php echo Text::_('COM_JEM_MAX_PLACES'); ?>"><?php echo Text::_('COM_JEM_MAX_PLACES'); ?>:</dt>
<dd class="register max-places"><?php echo $maxplaces; ?></dd>
<?php endif; ?>
<?php if (($maxplaces > 0) || ($reservedplaces > 0)) : ?>
<dt class="register booked-places hasTooltip" data-original-title="<?php echo Text::_('COM_JEM_RESERVED_PLACES'); ?>"><?php echo Text::_('COM_JEM_RESERVED_PLACES'); ?>:</dt>
<dd class="register booked-places">
<?php echo $reservedplaces; ?>
</dd>
<?php endif; ?>
<?php if ($maxplaces > 0) : ?>
<dt class="register booked-places hasTooltip" data-original-title="<?php echo Text::_('COM_JEM_BOOKED_PLACES'); ?>"><?php echo Text::_('COM_JEM_BOOKED_PLACES'); ?>:</dt>
<dd class="register booked-places"><?php echo $booked; ?></dd>
<?php endif; ?>
<?php if ($this->item->maxbookeduser > 0) : ?>
<dt><?php echo Text::_('COM_JEM_MAXIMUM_BOOKED_PLACES_PER_USER') ?>:</dt>
<dd><?php echo $this->item->maxbookeduser?></dd>
<?php endif; ?>
<?php if ($maxplaces > 0) : ?>
<dt class="register available-places hasTooltip" data-original-title="<?php echo Text::_('COM_JEM_AVAILABLE_PLACES'); ?>"><?php echo Text::_('COM_JEM_AVAILABLE_PLACES'); ?>:</dt>
<dd class="register available-places"><?php echo ($maxplaces - $booked - $reservedplaces); ?></dd>
<?php endif; ?>
<?php if ($waitinglist > 0) : ?>
<dt class="register waitinglist-places hasTooltip" data-original-title="<?php echo Text::_('COM_JEM_WAITING_PLACES'); ?>"><?php echo Text::_('COM_JEM_WAITING_PLACES'); ?>:</dt>
<dd class="register waitinglist-places"><?php echo $this->numWaitingPlaces; ?></dd>
<?php endif; ?>
<?php endif; /* Not show counters registration */ ?>
<?php
$this->registereduser = null;
// only set style info if users already have registered for event and user is allowed to see it
if ($this->registers) :
$showAttendenenames = $this->settings->get('event_show_attendeenames', 2);
switch ($showAttendenenames) {
case 1: // show to admins
if (!$this->user->authorise('core.manage', 'com_jem')) {
$showAttendenenames = 0;
}
break;
case 2: // show to registered
if ($this->user->get('guest')) {
$showAttendenenames = 0;
}
break;
case 3: // show to all
break;
case 4: // show only to user
break;
case 0: // show to none
default:
$showAttendenenames = 0;
}
if ($showAttendenenames) : ?>
<hr/>
<dt class="register registered-users hasTooltip" data-original-title="<?php echo Text::_('COM_JEM_REGISTERED_USERS'); ?>"><?php echo Text::_('COM_JEM_REGISTERED_USERS'); ?>:</dt>
<dd class="register registered-users">
<ul class="fa-ul jem-registered-list">
<?php
if ($this->settings->get('event_comunsolution', '0') == 1) :
if ($this->settings->get('event_comunoption', '0') == 1) :
//$cparams = ComponentHelper::getParams('com_media');
//$imgpath = $cparams->get('image_path'); // mostly 'images'
$imgpath = 'images'; // CB does NOT respect path set in Media Manager, so we have to ignore this too
if (File::exists(JPATH_ROOT . '/components/com_comprofiler/plugin/templates/default/images/avatar/tnnophoto_n.png')) {
$noimg = 'components/com_comprofiler/plugin/templates/default/images/avatar/tnnophoto_n.png';
} elseif (File::exists(JPATH_ROOT . '/components/com_comprofiler/images/english/tnnophoto.jpg')) {
$noimg = 'components/com_comprofiler/images/english/tnnophoto.jpg';
} else {
$noimg = '';
}
endif;
endif;
if(!function_exists("jem_getStatusIcon")) {
if ($this->settings->get('event_show_more_attendeedetails', '0')) {
function jem_getStatusIcon($status) {
switch($status) {
case 2: // waiting list
return ' <i class="fa fa-li fa-hourglass-half jem-attendance-status-fa-hourglass-half hasTooltip" title="'.Text::_('COM_JEM_ATTENDEES_ON_WAITINGLIST').'"></i>';
break;
case 1: // attending
return ' <i class="fa fa-li fa-check-circle jem-attendance-status-fa-check-circle hasTooltip" title="'.Text::_('COM_JEM_ATTENDEES_ATTENDING').'"></i>';
break;
case 0: // invited
return ' <i class="fa fa-li fa-question-circle jem-attendance-status-fa-question-circle hasTooltip" title="'.Text::_('COM_JEM_ATTENDEES_INVITED').'"></i>';
break;
case -1: // not attending
return ' <i class="fa fa-li fa-times-circle jem-attendance-status-fa-times-circle hasTooltip" title="'.Text::_('COM_JEM_ATTENDEES_NOT_ATTENDING').'"></i>';
break;
default:
return $status;
}
}
} else {
function jem_getStatusIcon($status) {
return ' <i class="fa fa-li fa-check-circle jem-attendance-status-fa-check-circle hasTooltip" title="'.Text::_('COM_JEM_ATTENDEES_ATTENDING').'"></i>';
}
}
}
foreach ($this->registers as $k => $register) :
if($showAttendenenames==4){
if($this->user->id != $register->uid){
continue;
}
} else if ($showAttendenenames==2) {
if($register->status==2){
continue;
}
}
echo '<li class="' . ($this->user->id==$register->uid? 'jem-registered-user-owner':'jem-registered-user') . '">' . jem_getStatusIcon($register->status);
$text = '';
$registedplaces = '';
// is a plugin catching this ?
if ($res = $this->dispatcher->triggerEvent('onAttendeeDisplay', array($register->uid, &$text))) :
echo $text;
endif;
//Registered user in the event
if($register->uid == $this->user->id) {
$this->registereduser = $k;
}
if($register->status==1 && $register->places>1){
$registedplaces = ' + ' . $register->places-1 . ' '. ($register->places-1>1? Text::_('COM_JEM_BOOKED_PLACES'): Text::_('COM_JEM_BOOKED_PLACE'));
}else if($register->status==-1 && $register->places>1){
$registedplaces = '';
}else if($register->status==0 && $register->places>1){
$registedplaces = ' + ' . $register->places-1 . ' '. ($register->places-1>1? Text::_('COM_JEM_INVITED_PLACES'): Text::_('COM_JEM_INVITED_PLACE'));
}else if($register->status==2 && $register->places>1){
$registedplaces = ' + ' . $register->places-1 . ' '. ($register->places-1>1? Text::_('COM_JEM_WAITING_PLACES'): Text::_('COM_JEM_WAITING_PLACE'));
}
// if CB
if ($this->settings->get('event_comunsolution', '0') == 1) :
$needle = 'index.php?option=com_comprofiler&view=userprofile';
$menu = Factory::getApplication()->getMenu();
$item = $menu->getItems('link', $needle, true);
$cntlink = !empty($item) ? $needle . '&user=' . $register->uid . '&Itemid=' . $item->id : $needle;
if ($this->settings->get('event_comunoption', '0') == 1) :
// User has avatar
if (!empty($register->avatar)) :
if (File::exists(JPATH_ROOT . '/' . $imgpath . '/comprofiler/tn' . $register->avatar)) {
$useravatar = HTMLHelper::image($imgpath . '/comprofiler/tn' . $register->avatar, $register->name);
} elseif (File::exists(JPATH_ROOT . '/' . $imgpath . '/comprofiler/' . $register->avatar)) {
$useravatar = HTMLHelper::image($imgpath . '/comprofiler/' . $register->avatar, $register->name);
} else {
$useravatar = empty($noimg) ? '' : HTMLHelper::image($noimg, $register->name);
}
echo '<a style="text-decoration: none;" href="' . Route::_($cntlink) . '" title = "' . Text::_('COM_JEM_SHOW_USER_PROFILE') . '">' . $useravatar . ' <span class="username">' . $register->name . '</span></a>' . $registedplaces;
// User has no avatar
else :
$nouseravatar = empty($noimg) ? '' : HTMLHelper::image($noimg, $register->name);
echo '<a style="text-decoration: none;" href="' . Route::_($cntlink) . '" title = "' . Text::_('COM_JEM_SHOW_USER_PROFILE') .'">' . $nouseravatar . ' <span class="username">' . $register->name . '</span></a>'. $registedplaces;
endif;
else :
// only show the username with link to profile
echo '<span class="username"><a style="text-decoration: none;" href="' . Route::_($cntlink) . '">' . $register->name . '</a></span>' . $registedplaces;
endif;
// if CB end - if not CB than only name
else :
// no communitycomponent is set so only show the username
echo '<span class="username">' . $register->name . '</span>' . $registedplaces;
endif;
echo '</li>';
// end loop through attendees
endforeach;
?>
</ul>
</dd>
<?php endif; ?>
<?php endif; ?>
<?php if ($this->permissions->canEditAttendees) : ?>
<dt></dt>
<dd><a href="<?php echo $linkreg; ?>" title="<?php echo Text::_('COM_JEM_MYEVENT_MANAGEATTENDEES'); ?>"><?php echo Text::_('COM_JEM_MYEVENT_MANAGEATTENDEES') ?> <i class="icon-out-2" aria-hidden="true"></i></a></dd>
<?php endif; ?>
</dl>
<hr />
<?php if ($this->print == 0) : ?>
<dl class="jem-dl floattext">
<dt class="register registration hasTooltip" data-original-title="<?php echo Text::_('COM_JEM_YOUR_REGISTRATION'); ?>"><?php echo Text::_('COM_JEM_YOUR_REGISTRATION'); ?>:</dt>
<dd class="register registration">
<?php
$uri = Uri::getInstance();
$returnUrl = $uri->toString();
$urlLogin = Route::_($uri->root() . 'index.php?option=com_users&view=login&return='.base64_encode($returnUrl));
if ($this->item->published != 1) {
echo Text::_('COM_JEM_WRONG_STATE_FOR_REGISTER');
} elseif (!$this->showRegForm) {
if(!$this->user->id){ ?>
<button class="btn btn-sm btn-warning text-white px-4 py-2" style="border: none; cursor: pointer; transition: background-color 0.3s;"
type="button" onclick="location.href='<?php echo $urlLogin; ?>'"><?php echo Text::_('COM_JEM_LOGIN_FOR_REGISTER'); ?></button>
<?php
}else{
echo Text::_('COM_JEM_NOT_ALLOWED_TO_REGISTER');
}
} else {
switch ($this->formhandler) {
case 0:
echo Text::_('COM_JEM_TOO_LATE_UNREGISTER');
break;
case 1:
echo Text::_('COM_JEM_TOO_LATE_REGISTER');
break;
case 2:
if ($this->item->requestanswer) { ?>
<span class="badge rounded-pill text-light bg-secondary">
<?php echo Text::_('COM_JEM_SEND_UNREGISTRATION');?>
</span>
<?php } ?>
<button class="btn btn-sm btn-warning text-white px-4 py-2" style="border: none; cursor: pointer; transition: background-color 0.3s;"
type="button" onclick="location.href='<?php echo $urlLogin; ?>'"><?php echo Text::_('COM_JEM_LOGIN_FOR_REGISTER'); ?></button>
<?php //insert Breezing Form hack here
/*<input class="btn btn-secondary" type="button" value="<?php echo Text::_('COM_JEM_SIGNUPHERE_AS_GUEST'); ?>" onClick="window.location='/index.php?option=com_breezingforms&view=form&Itemid=6089&event=<?php echo $this->item->title; ?>&date=<?php echo $this->item->dates ?>&conemail=<?php echo $this->item->conemail ?>';"/>
*/?>
<?php
break;
case 3:
if($this->item->reginvitedonly == 1){
if($this->isregistered === 0){
echo $this->loadTemplate('regform');
} else{
echo Text::_('COM_JEM_INVITED_USERS_ONLY') . '.<br>' . Text::_('COM_JEM_NOT_INVITED') . '.';
}
}
break;
case 4:
case 5:
echo $this->loadTemplate('regform');
break;
}
}
?>
</dd>
</dl>
<?php endif; ?>
</div>

View File

@ -0,0 +1,354 @@
<?php
/**
* @package JEM
* @copyright (C) 2013-2024 joomlaeventmanager.net
* @copyright (C) 2005-2009 Christoph Lukes
* @license https://www.gnu.org/licenses/gpl-3.0 GNU/GPL
*/
defined('_JEXEC') or die;
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Router\Route;
// The user is not already attending -> display registration form.
if ($this->showRegForm && empty($this->print)) :
if (($this->item->maxplaces > 0) && (($this->item->booked + $this->item->reservedplaces) >= $this->item->maxplaces) && !$this->item->waitinglist && empty($this->registration->status)) :
?>
<?php echo Text::_( 'COM_JEM_EVENT_FULL_NOTICE' ); ?>
<?php else :
//USER
$waitingPlacesUser = 0;
$placesBookedUser = 0;
$placesRegisteredUser = 0;
$statusRegistrationUser = -1;
$model = $this->getModel('event');
if ($this->item->maxbookeduser != 0) {
$placesavailableuser = $this->item->maxbookeduser;
if ($this->registereduser !== null) {
$placesavailableuser = $this->item->maxbookeduser - ($this->registers[$this->registereduser]->status > 0 ? $this->registers[$this->registereduser]->places : 0);
} else if ($this->item->waitinglist && $this->registration != null) {
if ($this->registration->status == 2) {
$placesavailableuser = $this->item->maxbookeduser - $this->registration->places;
$waitingPlacesUser = $this->registration->places;
$statusRegistrationUser = $this->registration->status;
}
}
} else {
$placesavailableuser = null;
}
//EVENT
if ($this->item->maxplaces) {
$placesavailableevent = $this->item->maxplaces - $this->item->booked - $this->item->reservedplaces;
if ($placesavailableuser === null) {
$placesavailableuser = $placesavailableevent;
}
} else {
$placesavailableevent = false;
}
if ($placesavailableevent != false) {
if ($placesavailableuser > 0 && ($placesavailableuser > $placesavailableevent)) {
$placesavailableuser = $placesavailableevent;
}
}
//BOOKED PLACES BY USER
if ($this->registereduser !== null) {
$statusRegistrationUser = $this->registers[$this->registereduser]->status;
if ($statusRegistrationUser == 1) {
$placesBookedUser = $this->registers[$this->registereduser]->places;
} else {
$placesBookedUser = 0;
}
$placesRegisteredUser = $this->registers[$this->registereduser]->places;
}
?>
<form id="JEM" action="<?php echo Route::_('index.php?option=com_jem&view=event&id=' . (int)$this->item->id); ?>" name="adminForm" id="adminForm" method="post">
<div>
<?php
if ($this->isregistered === false) {
if ($this->item->requestanswer) {
echo Text::_('COM_JEM_SEND_UNREGISTRATION');
}
if ($this->item->registra == 3) {
echo Text::_('COM_JEM_NOT_INVITED');
} else {
echo Text::_('COM_JEM_YOU_ARE_UNREGISTERED');
}
} else {
switch ($this->isregistered) :
case -1:
//You are NOT attending
echo Text::_('COM_JEM_YOU_ARE_NOT_ATTENDING');
break;
case 0:
//You're invited
echo Text::_('COM_JEM_YOU_ARE_INVITED');
break;
case 1:
//You're attending
if ($this->allowAnnulation) {
echo Text::_('COM_JEM_YOU_ARE_ATTENDING');
} else {
echo substr(Text::_('COM_JEM_YOU_ARE_ATTENDING'), 0,strpos(Text::_('COM_JEM_YOU_ARE_ATTENDING'), "<br>"));
}
break;
case 2:
//You're on Waitinglist
echo Text::_('COM_JEM_YOU_ARE_ON_WAITINGLIST');
break;
default:
//You didn't answer!
echo Text::_('COM_JEM_YOU_ARE_UNREGISTERED');
break;
endswitch;
}
if ($this->item->seriesbooking) {
// If event has 'seriesbooking' active and $checkseries is true then get all recurrence events of series from now (register or unregister)
$events = $model->getListRecurrenceEventsbyId($this->item->id, $this->item->recurrence_first_id, time(), $this->user->id);
if ($events) {
// Shown the active series event list
echo '<div class="pt-3">' . Text::_('COM_JEM_I_WILL_NOT_GO_SERIES_4') . '</div>';
echo '<div><table id="table-series"><thead><tr><th>' . Text::_('COM_JEM_DATE') . '</th><th>' . Text::_('COM_JEM_TITLE') . '</th><th>' . Text::_('COM_JEM_STATUS') . '</th><th>' . Text::_('COM_JEM_PLACES') . '</th><th>ID</th></tr></thead><tbody>';
foreach ($events as $e) {
if (!$e->waiting && $e->status == 1) {
$status = Text::_('COM_JEM_ATTENDEES_ATTENDING');
} else if ($e->waiting == 1 && $e->status == 1) {
$status = Text::_('COM_JEM_ATTENDEES_ON_WAITINGLIST');
} else if (!$e->status){
$status = Text::_('COM_JEM_ATTENDEES_INVITED');
} else if ($e->status == -1) {
$status = Text::_('COM_JEM_ATTENDEES_NOT_ATTENDING');
} else {
$status = Text::_('COM_JEM_ATTENDEES_STATUS_UNKNOWN');
}
echo '<tr><td nowrap>' . $e->dates . ' [' . ($e->times ? substr($e->times, 0, 5) : '') . ($e->endtimes ? '-' . substr($e->endtimes, 0, 5) : '') . ']</td><td>' . $e->title . '</td><td>' . $status . '</td><td>' . $e->places . '</td><td>' . $e->id . '</td></tr>';
}
echo '</tbody></table></div>';
echo '<div>&nbsp;</div>';
}
}
?>
</div>
<ul class="eventlist">
<li class="jem-event" onclick="document.getElementById('jem_register_event').click();">
<input id="jem_register_event" type="radio" name="reg_check" value="1" onclick="check(this, document.getElementById('jem_send_attend'));"
<?php if ($this->isregistered !== false
&& ($placesavailableevent === 0 || ($placesavailableuser === 0 && $statusRegistrationUser != 0))
&& (!$this->item->waitinglist || ($this->item->waitinglist && ($placesBookedUser || $placesavailableuser === 0)))
|| !$this->allowRegistration) {
echo 'disabled="disabled"';
} else {
echo 'checked="checked"';
} ?>
/>
<i class="fa fa-check-circle-o fa-lg jem-registerbutton" aria-hidden="true"></i>
<?php
//FULL AND WAITLIST
if ($this->item->maxplaces && (($this->item->booked + $this->item->reservedplaces) >= $this->item->maxplaces)) {
if ($this->item->waitinglist) {
if ($placesBookedUser) {
$placesavailableuser = 0;
echo Text::_('COM_JEM_EVENT_FULL_USER_REGISTERED_NO_WAITING_LIST');
} else {
echo Text::_('COM_JEM_EVENT_FULL_REGISTER_TO_WAITING_LIST');
}
} else {
if ($placesavailableevent === 0) {
echo Text::_('COM_JEM_NOT_AVAILABLE_PLACES_EVENT');
$placesavailableuser = 0;
}
}
} else {
//Option: I will attend
if ($this->registereduser !== null) {
if (!$placesBookedUser) {
echo Text::_('COM_JEM_I_WILL_GO');
}
} else {
echo Text::_('COM_JEM_I_WILL_GO');
if(!$this->allowRegistration){
echo '<span class="badge bg-warning text-light" role="alert">' . Text::_('COM_JEM_EVENT_REGISTRATION_CLOSED') . '</span>';
}
}
}
// for this user no additional places
if ($placesavailableuser === 0 || $this->registration === false) {
echo '<span class="badge bg-warning text-light" role="alert">' . Text::_('COM_JEM_NOT_AVAILABLE_PLACES_USER') . '</span>';
} else {
// Booking places
if ($this->item->maxbookeduser > 1) {
echo ' ' . Text::_('COM_JEM_I_WILL_GO_2');
echo ' <input id="addplaces" style="text-align: center; width:auto;" type="number" name="addplaces" '
. 'value="' . ($placesavailableuser > 0 ? ($this->item->maxbookeduser - $placesBookedUser < $placesavailableuser ? $this->item->minbookeduser - $placesBookedUser : 1) : ($placesavailableuser ?? 1))
. '" max="' . ($placesavailableuser > 0 ? ($this->item->maxbookeduser - $placesBookedUser < $placesavailableuser ? $this->item->maxbookeduser - $placesBookedUser : $placesavailableuser) : ($placesavailableuser ?? ''))
. '" min="' . ($placesavailableuser > 0 ? ($placesBookedUser - $this->item->minbookeduser >= 0 ? 1 : $this->item->minbookeduser - $placesBookedUser) : 0) . '">';
if ($this->registereduser != null) {
//Places
if ($placesBookedUser && $statusRegistrationUser == 1) {
echo ' ' . Text::_('COM_JEM_I_WILL_GO_3');
} else {
//Place
echo ' ' . Text::_('COM_JEM_PLACES_REG') . '.';
}
} else {
//Place
if ($this->item->maxbookeduser == $placesavailableuser) {
echo ' ' . Text::_('COM_JEM_PLACES_REG') . '.';
} else {
//Places
echo ' ' . Text::_('COM_JEM_I_WILL_GO_3');
}
}
} else {
echo ' <input id="addplaces" style="text-align: center; width:auto;" type="hidden" name="addplaces" value="1">';
}
if ($this->item->recurrence_type){
echo '<div class="p-3" >' . Text::_('COM_JEM_I_WILL_GO_SERIES_1') . '</div>';
if ($this->item->seriesbooking) {
// If event has 'seriesbooking' active and $checkseries is true then get all recurrence events of series from now (register or unregister)
if (!$this->registereduser){
$events = $model->getListRecurrenceEventsbyId($this->item->id, $this->item->recurrence_first_id, time());
}else{
$events = $model->getListRecurrenceEventsbyId($this->item->id, $this->item->recurrence_first_id, time(), $this->user->id, 1);
}
if($events) {
// Shown the active series event list
echo '<div class="px-3">' . Text::_('COM_JEM_I_WILL_GO_SERIES_4') . '</div>';
echo '<div class="px-3"><table id="table-series"><thead><tr><th>' . Text::_('COM_JEM_DATE') . '</th><th>' . Text::_('COM_JEM_TITLE') . '</th>' . ($this->registereduser? '<th>' . Text::_('COM_JEM_STATUS') . '</th><th>' . Text::_('COM_JEM_PLACES') . '</th>':'') . '<th>ID</th></tr></thead><tbody>';
foreach ($events as $e) {
if ($this->registereduser) {
switch ($e->status) {
case -1:
$status = Text::_('COM_JEM_ATTENDEES_NOT_ATTENDING');
break;
case 0:
$status = Text::_('COM_JEM_ATTENDEES_INVITED');
break;
case 1:
if ($e->waiting) {
$status = Text::_('COM_JEM_ATTENDEES_ON_WAITINGLIST');
} else {
$status = Text::_('COM_JEM_ATTENDEES_ATTENDING');
}
break;
default:
$status = Text::_('COM_JEM_ATTENDEES_STATUS_UNKNOWN');
break;
}
}
echo '<tr><td nowrap>' . $e->dates . ' [' . ($e->times ? substr($e->times, 0, 5) : '') . ($e->endtimes ? '-' . substr($e->endtimes, 0, 5) : '') . ']</td><td>' . $e->title . '</td>' . ($this->registereduser? '<td>' . $status . '</td><td>' . $e->places . '</td>':'') .'<td>' . $e->id . '</td></tr>';
}
echo '</tbody></table></div>';
if ($this->item->singlebooking) {
echo '<div class="px-3 pt-3"> <input id = "jem_unregister_event_series" type = "checkbox" name = "reg_check_series"> ' . Text::_('COM_JEM_I_WILL_GO_SERIES_2') . '</input ></div>';
} else {
echo '<div class="px-3 pt-3">' . Text::_('COM_JEM_I_WILL_GO_SERIES_3') . '</div>';
}
}
}
}
}
?>
</li>
<?php if ($this->item->requestanswer || $placesRegisteredUser || $waitingPlacesUser) {?>
<li class="jem-event" onclick="document.getElementById('jem_unregister_event').click();">
<?php if ($this->allowAnnulation || ($this->isregistered != 1) || $waitingPlacesUser) : ?>
<input id="jem_unregister_event" type="radio" name="reg_check" value="-1" onclick="check(this, document.getElementById('jem_send_attend'));"
<?php if ($this->isregistered !== false && $statusRegistrationUser>0 && $placesavailableuser==0) { echo 'checked="checked"'; } ?>
/>
<i class="fa fa-times-circle-o fa-lg jem-unregisterbutton" aria-hidden="true"></i>
<?php
//Option: I don't attend
echo ' ' . Text::_('COM_JEM_I_WILL_NOT_GO');
if ($this->registereduser !== null || $waitingPlacesUser) {
if ($placesRegisteredUser || $waitingPlacesUser) {
if ($statusRegistrationUser == 1) {
// Booked places
$cancelplaces = ($placesRegisteredUser - 1 > 1 ? Text::_('COM_JEM_BOOKED_PLACES') : Text::_('COM_JEM_BOOKED_PLACE'));
} else if ($statusRegistrationUser == -1) {
$cancelplaces = '';
//Booked places for invited users
} else if ($statusRegistrationUser == 0) {
$cancelplaces = ($placesRegisteredUser - 1 > 1 ? Text::_('COM_JEM_INVITED_PLACES') : Text::_('COM_JEM_INVITED_PLACE'));
//Booked places for waiting users
} else if ($statusRegistrationUser == 2) {
$cancelplaces = ($waitingPlacesUser - 1 > 1 ? Text::_('COM_JEM_WAITING_PLACES') : Text::_('COM_JEM_WAITING_PLACE'));
}
//Canceling...
echo ' ' . Text::_('COM_JEM_I_WILL_NOT_GO_2');
echo ' <input id="cancelplaces" style="text-align: center;" type="number" name="cancelplaces" value="' . ($placesRegisteredUser ? $placesRegisteredUser : $waitingPlacesUser) . '" max="' . ($placesRegisteredUser ? $placesRegisteredUser : $waitingPlacesUser) . '" min="1">' . ' ' . $cancelplaces;
}
if ($this->item->recurrence_type) {
echo '<div class="pt-3 pl-3">' . Text::_('COM_JEM_I_WILL_NOT_GO_SERIES_1') . '</div>';
if ($this->item->seriesbooking) {
if($events) {
if ($this->item->singlebooking) {
echo '<div class="px-3 pt-3"> <input id = "jem_unregister_event_series" type = "checkbox" name = "reg_check_series"> ' . Text::_('COM_JEM_I_WILL_NOT_GO_SERIES_2') . '</input ></div>';
} else {
echo '<div class="px-3">' . Text::_('COM_JEM_I_WILL_NOT_GO_SERIES_3') . '</div>';
}
}else{
echo '<div class="px-3">' . Text::_('COM_JEM_I_WILL_NOT_GO_SERIES_5') . '</div>';
}
}
}
} else {
//...booked places
$cancelplaces = Text::_('COM_JEM_I_WILL_NOT_GO_3');
}
?>
<?php else :
//Unregistration is not possible?>
<input type="radio" name="reg_dummy" value="" disabled="disabled" />
<i class="fa fa-times-circle-o fa-lg jem-unregisterbutton" aria-hidden="true"></i>
<?php echo ' ' . Text::_('COM_JEM_NOT_ALLOWED_TO_ANNULATE'); ?>
<?php endif; ?>
</li>
<?php }
$disabledOptions = ($placesavailableuser && !$this->allowRegistration) || (!$placesavailableuser && $this->allowRegistration && !$this->allowAnnulation) || (!$this->allowAnnulation && !$this->allowRegistration);
//Comment?>
<?php if (!empty($this->jemsettings->regallowcomments)) { ?>
<li class="jem-event jem-nopointer jem-nohover">
<p><?php echo Text::_('COM_JEM_OPTIONAL_COMMENT') . ':'; ?></p>
<div class="jem-regcomment">
<textarea class="inputbox" name="reg_comment" id="reg_comment" rows="3" cols="30" maxlength="255" <?php echo ($disabledOptions ? 'disabled="disabled"':'');?>><?php
if (is_object($this->registration) && !empty($this->registration->comment)) {
echo htmlspecialchars($this->registration->comment);
} ?></textarea>
</div>
</li>
<?php } ?>
</ul>
<input class="btn btn-sm btn-primary" type="submit" id="jem_send_attend" name="jem_send_attend"
<?php echo ($disabledOptions? 'disabled="disabled"':'');?>
value="<?php echo ($placesRegisteredUser ? Text::_('COM_JEM_SEND_REGISTER') : Text::_('COM_JEM_REGISTER')); ?>" />
<input type="hidden" name="rdid" value="<?php echo $this->item->did; ?>" />
<input type="hidden" name="regid" value="<?php echo (is_object($this->registration) ? $this->registration->id : 0); ?>" />
<input type="hidden" name="task" value="event.userregister"/>
<?php echo HTMLHelper::_('form.token'); ?>
</form>
<?php
endif; // full?
endif; // registra and not print

View File

@ -0,0 +1 @@
<!DOCTYPE html><title></title>

View File

@ -0,0 +1,532 @@
<?php
/**
* @package JEM
* @copyright (C) 2013-2024 joomlaeventmanager.net
* @copyright (C) 2005-2009 Christoph Lukes
* @license https://www.gnu.org/licenses/gpl-3.0 GNU/GPL
*/
defined('_JEXEC') or die;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\CMS\Uri\Uri;
use Joomla\CMS\Factory;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Plugin\PluginHelper;
/**
* Event-View
*/
class JemViewEvent extends JemView
{
protected $item;
protected $params;
protected $print;
protected $state;
protected $user;
public function __construct($config = array())
{
parent::__construct($config);
// additional path for common templates + corresponding override path
$this->addCommonTemplatePath();
}
/**
* Creates the output for the Event view
*/
public function display($tpl = null)
{
$jemsettings = JemHelper::config();
$settings = JemHelper::globalattribs();
$app = Factory::getApplication();
$user = JemFactory::getUser();
$userId = $user->get('id');
$dispatcher = JemFactory::getDispatcher();
$document = $app->getDocument();
$wa = $document->getWebAssetManager();
$model = $this->getModel();
$menu = $app->getMenu();
$menuitem = $menu->getActive();
$pathway = $app->getPathway();
$edit_att = new \stdClass();
$this->params = $app->getParams('com_jem');
$this->item = $this->get('Item');
$this->print = $app->input->getBool('print', false);
$this->state = $this->get('State');
$this->user = $user;
$this->jemsettings = $jemsettings;
$this->settings = $settings;
$categories = isset($this->item->categories) ? $this->item->categories : $this->get('Categories');
$this->categories = $categories;
$this->registers = null;
$registration = $this->get('UserRegistration');
$this->regs['not_attending'] = $model->getRegisters($this->state->get('event.id'), -1);
$this->regs['invited'] = $model->getRegisters($this->state->get('event.id'), 0);
$this->regs['attending'] = $model->getRegisters($this->state->get('event.id'), 1);
$this->regs['waiting'] = $model->getRegisters($this->state->get('event.id'), 2);
$this->regs['all'] = $model->getRegisters($this->state->get('event.id'), 'all');
// get number waiting places
$this->numWaitingPlaces=0;
if($this->regs['waiting']!= false){
foreach ($this->regs['waiting'] as $regwaitinguser){
$this->numWaitingPlaces = $this->numWaitingPlaces + $regwaitinguser->places;
}
}
// loop through attendees
$registers_array = array();
if($this->regs['all'])
{
if($userId){
if ($this->settings->get('event_show_more_attendeedetails', '0'))
{
$this->registers = $this->regs['all'];
}
else
{
$this->registers = $this->regs['attending'];
}
}else{
if ($this->settings->get('event_show_attendeenames', '0')==3)
{
$this->registers = $this->regs['attending'];
}
}
}
//JemHelper::addLogEntry("Attendees:\n" . print_r($this->registers, true), __METHOD__);
//JemHelper::addLogEntry("Attendees:\n" . print_r($this->regs, true), __METHOD__);
// check for data error
if (empty($this->item)) {
$app->enqueueMessage(Text::_('JERROR_AN_ERROR_HAS_OCCURRED'), 'error');
return false;
}
// Check for errors.
$errors = $this->get('Errors');
if (is_array($errors) && count($errors)) {
Factory::getApplication()->enqueueMessage(implode("\n", $errors), 'warning');
return false;
}
// Create a shortcut for $item and params.
$item = $this->item;
$params = $this->params;
// Decide which parameters should take priority
$useMenuItemParams = ($menuitem && $menuitem->query['option'] == 'com_jem'
&& $menuitem->query['view'] == 'event'
&& $menuitem->query['id'] == $item->id);
// Add router helpers.
$item->slug = $item->alias ? ($item->id.':'.$item->alias) : $item->id;
$item->venueslug = $item->localias ? ($item->locid.':'.$item->localias) : $item->locid;
// Check to see which parameters should take priority
if ($useMenuItemParams) {
// Merge so that the menu item params take priority
$pagetitle = $params->def('page_title', $menuitem->title ? $menuitem->title : $item->title);
$params->def('page_heading', $pagetitle);
$pathwayKeys = array_keys($pathway->getPathway());
$lastPathwayEntryIndex = end($pathwayKeys);
$pathway->setItemName($lastPathwayEntryIndex, $menuitem->title);
//$pathway->setItemName(1, $menuitem->title);
// Load layout from active query (in case it is an alternative menu item)
if (isset($menuitem->query['layout'])) {
$this->setLayout($menuitem->query['layout']);
} else {
// Single-event menu item layout takes priority over alt layout for an event
if ($layout = $item->params->get('event_layout')) {
$this->setLayout($layout);
}
}
$item->params->merge($params);
} else {
// Merge the menu item params with the event params so that the event params take priority
$pagetitle = $item->title;
$params->set('page_title', $pagetitle);
$params->set('page_heading', $pagetitle);
$params->set('show_page_heading', 1); // ensure page heading is shown
$pathway->addItem($pagetitle, Route::_(JemHelperRoute::getEventRoute($item->slug)));
// Check for alternative layouts (since we are not in a single-event menu item)
// Single-event menu item layout takes priority over alt layout for an event
if ($layout = $item->params->get('event_layout')) {
$this->setLayout($layout);
}
$temp = clone($params);
$temp->merge($item->params);
$item->params = $temp;
}
$offset = $this->state->get('list.offset');
// Check the view access to the event (the model has already computed the values).
if (!$item->params->get('access-view')) { // && !$item->params->get('show_noauth') && $user->get('guest')) { - not supported yet
Factory::getApplication()->enqueueMessage(Text::_('JERROR_ALERTNOAUTHOR'), 'warning');
return;
}
if ($item->params->get('show_intro', '1') == '1') {
$item->text = $item->introtext.' '.$item->fulltext;
}
elseif ($item->fulltext) {
$item->text = $item->fulltext;
}
else {
$item->text = $item->introtext;
}
// Process the content plugins //
PluginHelper::importPlugin('content');
$results = $dispatcher->triggerEvent('onContentPrepare', array ('com_jem.event', &$item, &$this->params, $offset));
$item->event = new stdClass();
$results = $dispatcher->triggerEvent('onContentAfterTitle', array('com_jem.event', &$item, &$this->params, $offset));
$item->event->afterDisplayTitle = trim(implode("\n", $results));
$results = $dispatcher->triggerEvent('onContentBeforeDisplay', array('com_jem.event', &$item, &$this->params, $offset));
$item->event->beforeDisplayContent = trim(implode("\n", $results));
$results = $dispatcher->triggerEvent('onContentAfterDisplay', array('com_jem.event', &$item, &$this->params, $offset));
$item->event->afterDisplayContent = trim(implode("\n", $results));
//use temporary class var to triggerEvent content prepare plugin for venue description
$tempVenue = new stdClass();
$tempVenue->text = $item->locdescription ?? '';
$tempVenue->title = $item->venue ?? '';
$results = $dispatcher->triggerEvent('onContentPrepare', array ('com_jem.event', &$tempVenue, &$this->params, $offset));
$item->locdescription = $tempVenue->text;
$item->venue = $tempVenue->title;
// Increment the hit counter of the event.
if (!$this->params->get('intro_only') && $offset == 0) {
$model->hit();
}
// Escape strings for HTML output
$pageclass_sfx = $this->item->params->get('pageclass_sfx');
$this->pageclass_sfx = $pageclass_sfx ? htmlspecialchars($pageclass_sfx) : $pageclass_sfx;
$this->print_link = Route::_(JemHelperRoute::getRoute($item->slug).'&print=1&tmpl=component');
// Get images
$this->dimage = JemImage::flyercreator($item->datimage, 'event');
$this->limage = JemImage::flyercreator($item->locimage, 'venue');
// Check if the user has permission to add things
$permissions = new stdClass();
$permissions->canAddEvent = $user->can('add', 'event');
$permissions->canAddVenue = $user->can('add', 'venue');
// Check if user can edit the event
$permissions->canEditEvent = $user->can('edit', 'event', $item->id, $item->created_by);
$permissions->canPublishEvent = $user->can('publish', 'event', $item->id, $item->created_by);
// Check if user can edit the venue
$permissions->canEditVenue = $user->can('edit', 'venue', $item->locid, $item->venueowner);
$permissions->canPublishVenue = $user->can('publish', 'venue', $item->locid, $item->venueowner);
// Check if user can edit attendees
$isAuthor = $userId && ($userId == $item->created_by);
//$permissions->canEditAttendees = $isAuthor;
//new logic: user can edit events, suggested by jojo12
$permissions->canEditAttendees = $user->can('edit', 'event', $item->id, $item->created_by);
//suggestion by M59S to allow groupmembers too see line 230/231 too
$edit_att->canEditAttendees = $user->can('edit', 'event', $item->id, $item->created_by);
$this->permissions = $permissions;
$this->showeventstate = $permissions->canEditEvent || $permissions->canPublishEvent;
$this->showvenuestate = $permissions->canEditVenue || $permissions->canPublishVenue;
/** show attendees and registration form if registration globally allowed or optional and on event allowed
* but if on event limited to invited users and limitation globally allowed user must be invited
* (or event owner to see attendees)
*/
$g_reg = $this->jemsettings->showfroregistra;
$g_inv = $this->jemsettings->regallowinvitation;
$e_dates = $item->dates;
$e_times = $item->times;
$e_reg = $item->registra;
$e_unreg = $item->unregistra;
$e_unreg_until = $item->unregistra_until;
$e_invitedonly = $item->reginvitedonly;
$this->showAttendees = (($g_reg == 1) || (($g_reg == 2) && ($e_reg & 1 || $e_reg & 2))) && ((!(($e_invitedonly & 1) && ($g_inv > 0))) || (is_object($registration) || $isAuthor) || $edit_att);
$this->showRegForm = (($g_reg == 1) || (($g_reg == 2) && ($e_reg & 1 || $e_reg & 2))) && ((!(($e_invitedonly & 1) && ($g_inv > 0))) || (is_object($registration)));
$this->e_reg = $e_reg;
$timeNow = time();
$this->dateRegistationFrom = strtotime(($item->registra_from ?? ''));
$this->dateRegistationUntil = strtotime(($item->registra_until ?? ''));
$this->dateUnregistationUntil = strtotime(($item->unregistra_until ?? ''));
$this->allowRegistration = ($e_reg == 1) || (($e_reg == 2) && (empty($e_dates) || ($this->dateRegistationFrom <= $timeNow && ($this->dateRegistationUntil? $timeNow < $this->dateRegistationUntil : 1))));
$this->allowAnnulation = ($e_unreg == 1) || (($e_unreg == 2) && (empty($e_dates) || (strtotime($e_unreg_until ?? '') > strtotime('now'))));
// Timecheck for registration
$now = strtotime(date("Y-m-d"));
$date = empty($item->dates) ? $now : strtotime($item->dates);
$enddate = empty($item->enddates) ? $date : strtotime($item->enddates);
$timecheck = $now - $date; // on open date $timecheck is 0
// let's build the registration handling
$formhandler = 0; // too late to unregister
if (is_object($registration)){
if($registration->status != 0) { // is the user allready registered at the event
if ($now <= $enddate) { // allows registration changes on unfinished events
$formhandler = 4;
}
} else {
if($e_invitedonly) {
$formhandler = 3; // invited user (no registration) in event for invited users only
} else {
$formhandler = 4; // invited user (no registration) in event open for all users
}
}
} elseif ($timecheck > 0) { // check if it is too late to register and overwrite $formhandler
$formhandler = 1;
} elseif (!$userId) { // user doesn't have an ID (mostly guest)
$formhandler = 2;
} else {
$formhandler = 5; // allow registration, can be invited user
}
if ($formhandler >= 3) {
// user must click one of the radio buttons to enable Send button
$js = "function check(box, send) {
if(box.checked==true){
send.disabled = false;
} else {
send.disabled = true;
}}";
$wa->addInlineScript($js);
}
$this->formhandler = $formhandler;
// generate Metatags
$meta_keywords = array();
if (!empty($this->item->meta_keywords)) {
$keywords = explode(",", $this->item->meta_keywords);
foreach ($keywords as $keyword) {
if (preg_match("/[\/[\/]/", $keyword)) {
$keyword = trim(str_replace("[", "", str_replace("]", "", $keyword)));
$buffer = $this->keyword_switcher($keyword, $this->item, $categories, $jemsettings->formattime, $jemsettings->formatdate);
if (!empty($buffer)) {
$meta_keywords[] = $buffer;
}
} else {
$meta_keywords[] = $keyword;
}
}
$document->setMetadata('keywords', implode(', ', $meta_keywords));
}
if (!empty($this->item->meta_description)) {
$description = explode("[", $this->item->meta_description);
$description_content = "";
foreach ($description as $desc) {
$endpos = \Joomla\String\StringHelper::strpos($desc, "]", 0);
if ($endpos > 0) {
$keyword = \Joomla\String\StringHelper::substr($desc, 0, $endpos);
$description_content .= $this->keyword_switcher($keyword, $this->item, $categories, $jemsettings->formattime, $jemsettings->formatdate);
$description_content .= \Joomla\String\StringHelper::substr($desc, $endpos + 1);
} else {
$description_content .= $desc;
}
}
} else {
$description_content = "";
}
$document->setDescription(strip_tags($description_content));
// load dispatcher for JEM plugins (comments)
$item->pluginevent = new stdClass();
if ($this->print) {
$item->pluginevent->onEventEnd = false;
} else {
PluginHelper::importPlugin('jem', 'comments');
$results = $dispatcher->triggerEvent('onEventEnd', array($item->did, $this->escape($item->title)));
$item->pluginevent->onEventEnd = trim(implode("\n", $results));
}
// create flag
if ($item->country) {
$item->countryimg = JemHelperCountries::getCountryFlag($item->country);
}
/* a bit backwaard compatibility... */
if (is_object($registration)) {
$this->isregistered = $registration->status;
} else {
$this->isregistered = false;
}
$this->registration = $registration;
$this->dispatcher = $dispatcher;
$pageclass_sfx = $item->params->get('pageclass_sfx');
$this->pageclass_sfx = $pageclass_sfx ? htmlspecialchars($pageclass_sfx) : $pageclass_sfx;
$this->itemid = $menuitem ? $menuitem->id : false;
//Get itemRoot if item is a recurrence event
$this->item_root = 0;
if($this->item->recurrence_type){
$this->item_root = $model->getItem($this->item->recurrence_first_id );
}
$this->_prepareDocument();
parent::display($tpl);
}
/**
* structures the keywords
*/
protected function keyword_switcher($keyword, $row, $categories, $formattime, $formatdate)
{
$content = '';
switch ($keyword)
{
case 'categories':
$catnames = array();
foreach ($categories as $category) {
$catnames[] = $this->escape($category->catname);
}
$content = implode(', ', array_filter($catnames));
break;
case 'a_name':
$content = $row->venue;
break;
case 'times':
case 'endtimes':
if (isset($row->$keyword)) {
$content = JemOutput::formattime($row->$keyword);
}
break;
case 'dates':
case 'enddates':
if (isset($row->$keyword)) {
$content = JemOutput::formatdate($row->$keyword);
}
break;
case 'title':
default:
if (isset($row->$keyword)) {
$content = $row->$keyword;
}
break;
}
return $content;
}
/**
* Prepares the document
*/
protected function _prepareDocument()
{
$app = Factory::getApplication();
// $menus = $app->getMenu();
// $pathway = $app->getPathway();
// add css file
JemHelper::loadCss('jem');
JemHelper::loadCustomCss();
JemHelper::loadCustomTag();
if ($this->print) {
JemHelper::loadCss('print');
$this->document->setMetaData('robots', 'noindex, nofollow');
}
/*
// Because the application sets a default page title,
// we need to get it from the menu item itself
$menu = $menus->getActive();
if ($menu) {
$this->params->def('page_heading', $this->params->get('page_title', $menu->title));
} else {
$this->params->def('page_heading', Text::_('JGLOBAL_JEM_EVENT'));
}
*/
$title = $this->params->get('page_title', '');
/*
$id = (int) @$menu->query['id'];
// if the menu item does not concern this event
if ($menu && ($menu->query['option'] != 'com_jem' || $menu->query['view'] != 'event' || $id != $this->item->id)) {
// If this is not a single event menu item, set the page title to the event title
if ($this->item->title) {
$title = $this->item->title;
}
$path = array(array('title' => $this->item->title, 'link' => ''));
$category = JCategories::getInstance('JEM2')->get($this->item->catid);
while ($category && ($menu->query['option'] != 'com_jem' || $menu->query['view'] == 'event'
|| $id != $category->id) && $category->id > 1) {
$path[] = array('title' => $category->catname, 'link' => JemHelperRoute::getCategoryRoute($category->id));
$category = $category->getParent();
}
$path = array_reverse($path);
foreach($path as $item) {
$pathway->addItem($item['title'], $item['link']);
}
}
*/
// Check for empty title and add site name if param is set
if (empty($title)) {
$title = $app->get('sitename');
} elseif ($app->get('sitename_pagetitles', 0) == 1) {
$title = Text::sprintf('JPAGETITLE', $app->get('sitename'), $title);
} elseif ($app->get('sitename_pagetitles', 0) == 2) {
$title = Text::sprintf('JPAGETITLE', $title, $app->get('sitename'));
}
if (empty($title)) {
$title = $this->item->title;
}
$this->document->setTitle($title);
if ($this->params->get('robots')) {
$this->document->setMetadata('robots', $this->params->get('robots'));
}
if ($app->get('MetaAuthor') == '1') {
$this->document->setMetaData('author', $this->item->author);
}
$mdata = $this->item->metadata->toArray();
foreach ($mdata as $k => $v) {
if ($v) {
$this->document->setMetadata($k, $v);
}
}
// If there is a pagebreak heading or title, add it to the page title
if (!empty($this->item->page_title)) {
$this->item->title = $this->item->title . ' - ' . $this->item->page_title;
$this->document->setTitle($this->item->page_title . ' - '
. Text::sprintf('PLG_CONTENT_PAGEBREAK_PAGE_NUM', $this->state->get('list.offset') + 1));
}
}
}
?>

View File

@ -0,0 +1,51 @@
<?php
/**
* @package JEM
* @copyright (C) 2013-2024 joomlaeventmanager.net
* @copyright (C) 2005-2009 Christoph Lukes
* @license https://www.gnu.org/licenses/gpl-3.0 GNU/GPL
*/
defined('_JEXEC') or die;
use Joomla\CMS\MVC\View\HtmlView;
/**
* Event-Raw
*/
class JemViewEvent extends HtmlView
{
/**
* Creates the output for the event view
*/
public function display($tpl = null)
{
$settings = JemHelper::globalattribs();
// check iCal global setting
if ($settings->get('global_show_ical_icon','0')==1) {
// Get data from the model
$row = $this->get('Item');
if (empty($row)) {
return;
}
$row->categories = $this->get('Categories');
$row->id = $row->did;
$row->slug = $row->alias ? ($row->id.':'.$row->alias) : $row->id;
$params = $row->params;
// check individual iCal Event setting
if ($params->get('event_show_ical_icon',1)) {
// initiate new CALENDAR
$vcal = JemHelper::getCalendarTool();
$vcal->setConfig( "filename", "event".$row->did.".ics" );
JemHelper::icalAddEvent($vcal, $row);
// generate and redirect output to user browser
$vcal->returnCalendar();
}
}
}
}
?>