rifiniture di stile rifiniture primo rilascio di test

This commit is contained in:
2025-01-08 19:26:51 +01:00
parent 832a39a71d
commit f9bb7e1003
96 changed files with 8256 additions and 526 deletions

View File

@ -0,0 +1,563 @@
<?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 class="container">
<div class="row">
<div class="col-12 col-lg-9">
<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>
</div>
<div class="tipologia-menu ps-lg-4 col-lg-3">
<aside class="aside-list aside-sticky">
<div class="menu-laterale">
<?= JHtml::_('content.prepare', '{loadposition right}'); ?>
</div>
</aside>
</div>
</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