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,164 @@
<?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\Router\Route;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Factory;
HTMLHelper::addIncludePath(JPATH_COMPONENT.'/helpers/html');
$user = JemFactory::getUser();
$userId = $user->get('id');
$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));
$document = Factory::getApplication()->getDocument();
$wa = $document->getWebAssetManager();
$wa->addInlineScript('
Joomla.submitbutton = function(task)
{
document.adminForm.task.value=task;
if (task == "attendees.export") {
Joomla.submitform(task, document.getElementById("adminForm"));
document.adminForm.task.value="";
} else {
Joomla.submitform(task, document.getElementById("adminForm"));
}
};
');
$wa->addInlineScript('
function submitName(node) {
node.parentNode.previousElementSibling.childNodes[0].checked = true;
Joomla.submitbutton("attendees.edit");
}
');
?>
<form action="<?php echo Route::_('index.php?option=com_jem&view=attendees&eventid='.$this->event->id); ?>" method="post" name="adminForm" id="adminForm">
<div id="j-main-container" class="j-main-container">
<fieldset id="filter-bar" class="mb-3">
<div class="row">
<div class="col-md-11">
<div class="row mb-12">
<div class="col-md-2">
<strong><?php echo Text::_('COM_JEM_DATE').':'; ?></strong>&nbsp;<?php echo $this->event->dates; ?><br />
</div>
<div class="col-md-2">
<strong><?php echo Text::_('COM_JEM_EVENT_TITLE').':'; ?></strong>&nbsp;<?php echo $this->escape($this->event->title); ?>
</div>
</div>
</div>
<div class="col-md-1">
<div class="row">
<div class="wauto-minwmax">
<div class="float-end">
<?php echo $this->pagination->getLimitBox(); ?>
</div>
</div>
</div>
</div>
</div>
</fieldset>
<table class="adminform">
<tr>
<td width="100%">
<?php echo Text::_('COM_JEM_SEARCH').' '.$this->lists['filter']; ?>
<input type="text" name="filter_search" id="filter_search" value="<?php echo $this->lists['search']; ?>" class="text_area" onChange="document.adminForm.submit();" />
<button class="buttonfilter" type="submit"><?php echo Text::_('JSEARCH_FILTER_SUBMIT'); ?></button>
<button class="buttonfilter" type="button" onclick="document.getElementById('filter_search').value='';this.form.submit();"><?php echo Text::_('JSEARCH_FILTER_CLEAR'); ?></button>
</td>
<td style="text-align:right; white-space:nowrap;">
<?php echo Text::_('COM_JEM_STATUS').' '.$this->lists['status']; ?>
</td>
</tr>
</table>
<table class="table table-striped" id="attendeeList">
<thead>
<tr>
<th width="1%" class="center"><input type="checkbox" name="checkall-toggle" value="" title="<?php echo Text::_('JGLOBAL_CHECK_ALL'); ?>" onclick="Joomla.checkAll(this)" /></th>
<th class="title"><?php echo HTMLHelper::_('grid.sort', 'COM_JEM_NAME', 'u.name', $listDirn, $listOrder); ?></th>
<th class="title"><?php echo HTMLHelper::_('grid.sort', 'COM_JEM_USERNAME', 'u.username', $listDirn, $listOrder); ?></th>
<th class="title"><?php echo Text::_('COM_JEM_EMAIL'); ?></th>
<th class="title"><?php echo Text::_('COM_JEM_IP_ADDRESS'); ?></th>
<th class="title"><?php echo HTMLHelper::_('grid.sort', 'COM_JEM_REGDATE', 'r.uregdate', $listDirn, $listOrder); ?></th>
<th class="title center"><?php echo HTMLHelper::_('grid.sort', 'COM_JEM_USER_ID', 'r.uid', $listDirn, $listOrder); ?></th>
<th class="title center"><?php echo HTMLHelper::_('grid.sort', 'COM_JEM_HEADER_WAITINGLIST_STATUS', 'r.waiting',$listDirn, $listOrder); ?></th>
<th class="title center"><?php echo HTMLHelper::_('grid.sort', 'COM_JEM_ATTENDEES_PLACES', 'r.waiting',$listDirn, $listOrder); ?></th>
<?php if (!empty($this->jemsettings->regallowcomments)) : ?>
<th class="title"><?php echo Text::_('COM_JEM_COMMENT'); ?></th>
<?php endif;?>
<th class="title center"><?php echo Text::_('COM_JEM_REMOVE_USER'); ?></th>
<th width="1%" class="center nowrap"><?php echo HTMLHelper::_('grid.sort', 'COM_JEM_ATTENDEES_REGID', 'r.id', $listDirn, $listOrder ); ?></th>
</tr>
</thead>
<tbody>
<?php
$canChange = $user->authorise('core.edit.state');
foreach ($this->items as $i => $row) :
?>
<tr class="row<?php echo $i % 2; ?>">
<td class="center"><?php echo HTMLHelper::_('grid.id', $i, $row->id); ?></td> <?php // Die ID kann man doch auch als Parameter für "submitName()" nehmen. Dann muss ich nicht erst den Baum entlang hangeln ?>
<td><a href="<?php echo Route::_('index.php?option=com_jem&view=attendee&event='.$row->event . '&id='.$row->id);?>"><?php echo $row->name; ?></a></td>
<td><?php echo $row->username; ?></td>
<td class="email"><a href="mailto:<?php echo $row->email; ?>"><?php echo $row->email; ?></a></td>
<td><?php echo $row->uip == 'DISABLED' ? Text::_('COM_JEM_DISABLED') : $row->uip; ?></td>
<td><?php if (!empty($row->uregdate)) { echo HTMLHelper::_('date', $row->uregdate, Text::_('DATE_FORMAT_LC2')); } ?></td>
<td class="center">
<a href="<?php echo Route::_('index.php?option=com_users&task=user.edit&id='.$row->uid); ?>"><?php echo $row->uid; ?></a>
</td>
<td class="center">
<?php
$status = (int)$row->status;
if($this->event->waitinglist) {
if ($status === 1 && $row->waiting == 1) {
$status = 2;
}
echo jemhtml::toggleAttendanceStatus($i, $status, $canChange);
} else {
echo jemhtml::toggleAttendanceStatus($i, $status, false);
}
?>
</td>
<td class="center">
<?php echo $row->places; ?>
</td>
<?php if (!empty($this->jemsettings->regallowcomments)) : ?>
<?php $cmnt = (\Joomla\String\StringHelper::strlen($row->comment) > 16) ? (rtrim(\Joomla\String\StringHelper::substr($row->comment, 0, 14)).'&hellip;') : $row->comment; ?>
<td><?php if (!empty($cmnt)) { echo HTMLHelper::_('tooltip', $row->comment, null, null, $cmnt, null, null); } ?></td>
<?php endif; ?>
<td class="center">
<a href="javascript: void(0);" onclick="return Joomla.listItemTask('cb<?php echo $i;?>','attendees.remove')">
<?php echo HTMLHelper::_('image','com_jem/publish_r.png',Text::_('COM_JEM_REMOVE'),NULL,true); ?>
</a>
</td>
<td class="center">
<?php echo $this->escape($row->id); ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<div class="ms-auto mb-4 me-0">
<?php echo (method_exists($this->pagination, 'getPaginationLinks') ? $this->pagination->getPaginationLinks(null) : $this->pagination->getListFooter()); ?>
</div>
</div>
<div>
<input type="hidden" name="task" value=""/>
<input type="hidden" name="boxchecked" value="0"/>
<input type="hidden" name="filter_order" value="<?php echo $listOrder; ?>"/>
<input type="hidden" name="filter_order_Dir" value="<?php echo $listDirn; ?>"/>
<?php echo HTMLHelper::_('form.token'); ?>
</div>
</form>

View File

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

View File

@ -0,0 +1,78 @@
<?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;
?>
<table style="width:100%" class="adminlist">
<tr>
<td class="sectionname" width="100%" style="color: #C24733; font-size: 18px; font-weight: bold;"><?php echo Text::_('COM_JEM_REGISTERED_USER'); ?></td>
<td><div class="button2-left"><div class="blank"><a href="#" onclick="window.print();return false;"><?php echo Text::_('COM_JEM_PRINT'); ?></a></div></div></td>
</tr>
</table>
<br />
<table class="adminlist" style="width:100%">
<tr>
<td align="left">
<b><?php echo Text::_('COM_JEM_DATE').':'; ?></b>&nbsp;<?php echo $this->event->dates; ?><br />
<b><?php echo Text::_('COM_JEM_EVENT_TITLE').':'; ?></b>&nbsp;<?php echo $this->escape($this->event->title); ?>
</td>
</tr>
</table>
<br />
<table class="table table-striped" id="attendeesList">
<thead>
<tr>
<th class="title"><?php echo Text::_('COM_JEM_NAME'); ?></th>
<th class="title"><?php echo Text::_('COM_JEM_USERNAME'); ?></th>
<th class="title"><?php echo Text::_('COM_JEM_EMAIL'); ?></th>
<th class="title"><?php echo Text::_('COM_JEM_REGDATE'); ?></th>
<?php if ($this->event->waitinglist): ?>
<th class="title"><?php echo Text::_('COM_JEM_HEADER_WAITINGLIST_STATUS' ); ?></th>
<?php endif; ?>
<?php if (!empty($this->jemsettings->regallowcomments)) : ?>
<th class="title"><?php echo Text::_('COM_JEM_COMMENT'); ?></th>
<?php endif; ?>
<th class="title center"><?php echo Text::_('COM_JEM_USER_ID'); ?></th>
</tr>
</thead>
<tbody>
<?php
foreach ($this->rows as $i => $row) :
?>
<tr class="row<?php echo $i % 2; ?>">
<td><?php echo $row->name; ?></td>
<td><?php echo $row->username; ?></td>
<td><?php echo $row->email; ?></td>
<td><?php if (!empty($row->uregdate)) { echo HTMLHelper::_('date', $row->uregdate, Text::_('DATE_FORMAT_LC2')); } ?></td>
<?php
switch ($row->status) {
case -1: // explicitely unregistered
$text = 'COM_JEM_ATTENDEES_NOT_ATTENDING';
break;
case 0: // invited, not answered yet
$text = 'COM_JEM_ATTENDEES_INVITED';
break;
case 1: // registered
$text = $row->waiting ? 'COM_JEM_ATTENDEES_ON_WAITINGLIST' : 'COM_JEM_ATTENDEES_ATTENDING';
break;
default: // oops...
$text = 'COM_JEM_ATTENDEES_STATUS_UNKNOWN';
break;
} ?>
<td><?php echo Text::_($text); ?></td>
<?php if (!empty($this->jemsettings->regallowcomments)) : ?>
<td><?php echo $row->comment; ?></td>
<?php endif; ?>
<td class="center"><?php echo $row->uid; ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>

View File

@ -0,0 +1,150 @@
<?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\Factory;
use Joomla\CMS\Toolbar\Toolbar;
/**
* View class: Attendees
*/
class JemViewAttendees extends JemAdminView
{
public function display($tpl = null)
{
$app = Factory::getApplication();
$db = Factory::getContainer()->get('DatabaseDriver');
$this->jemsettings = JemHelper::config();
if($this->getLayout() == 'print') {
$this->_displayprint($tpl);
return;
}
$filter_status = $app->getUserStateFromRequest('com_jem.attendees.filter_status', 'filter_status', -2, 'int');
$filter_type = $app->getUserStateFromRequest('com_jem.attendees.filter_type', 'filter_type', 0, 'int');
$filter_search = $app->getUserStateFromRequest('com_jem.attendees.filter_search', 'filter_search', '', 'string');
$filter_search = $db->escape(trim(\Joomla\String\StringHelper::strtolower($filter_search)));
// Load css
$wa = Factory::getApplication()->getDocument()->getWebAssetManager();
$wa->registerStyle('jem.backend', 'com_jem/backend.css')->useStyle('jem.backend');
// Get data from the model
$event = $this->get('Event');
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
// Check for errors.
$errors = $this->get('Errors');
if (is_array($errors) && count($errors)) {
Factory::getApplication()->enqueueMessage(implode("\n", $errors), 'error');
return false;
}
// check for data error
if (empty($event)) {
$app->enqueueMessage(Text::_('JERROR_AN_ERROR_HAS_OCCURRED'), 'error');
return false;
}
if (JemHelper::isValidDate($event->dates)) {
$event->dates = JemOutput::formatdate($event->dates);
} else {
$event->dates = Text::_('COM_JEM_OPEN_DATE');
}
//build filter selectlist
$filters = array();
$filters[] = HTMLHelper::_('select.option', '1', Text::_('COM_JEM_NAME'));
$filters[] = HTMLHelper::_('select.option', '2', Text::_('COM_JEM_USERNAME'));
$lists['filter'] = HTMLHelper::_('select.genericlist', $filters, 'filter_type', array('size'=>'1','class'=>'inputbox'), 'value', 'text', $filter_type);
// search filter
$lists['search'] = $filter_search;
// registration status
$options = array(HTMLHelper::_('select.option', -2, Text::_('COM_JEM_ATT_FILTER_ALL')),
HTMLHelper::_('select.option', 0, Text::_('COM_JEM_ATT_FILTER_INVITED')),
HTMLHelper::_('select.option', -1, Text::_('COM_JEM_ATT_FILTER_NOT_ATTENDING')),
HTMLHelper::_('select.option', 1, Text::_('COM_JEM_ATT_FILTER_ATTENDING')),
HTMLHelper::_('select.option', 2, Text::_('COM_JEM_ATT_FILTER_WAITING')));
$lists['status'] = HTMLHelper::_('select.genericlist', $options, 'filter_status', array('onChange'=>'this.form.submit();'), 'value', 'text', $filter_status);
//assign to template
$this->lists = $lists;
$this->event = $event;
// add toolbar
$this->addToolbar();
parent::display($tpl);
}
/**
* Prepares the print screen
*/
protected function _displayprint($tpl = null)
{
// Load css
HTMLHelper::_('stylesheet', 'com_jem/backend.css', array(), true);
$rows = $this->get('Items');
$event = $this->get('Event');
if (JemHelper::isValidDate($event->dates)) {
$event->dates = JemOutput::formatdate($event->dates);
} else {
$event->dates = Text::_('COM_JEM_OPEN_DATE');
}
//assign data to template
$this->rows = $rows;
$this->event = $event;
parent::display($tpl);
}
/**
* Add Toolbar
*/
protected function addToolbar()
{
ToolbarHelper::title(Text::_('COM_JEM_REGISTERED_USERS'), 'users');
ToolbarHelper::addNew('attendees.add');
ToolbarHelper::editList('attendees.edit');
ToolbarHelper::custom('attendees.setNotAttending', 'loop', 'loop', Text::_('COM_JEM_ATTENDEES_SETNOTATTENDING'), true);
ToolbarHelper::custom('attendees.setAttending', 'loop', 'loop', Text::_('COM_JEM_ATTENDEES_SETATTENDING'), true);
if ($this->event->waitinglist) {
ToolbarHelper::custom('attendees.setWaitinglist', 'loop', 'loop', Text::_('COM_JEM_ATTENDEES_SETWAITINGLIST'), true);
}
ToolbarHelper::spacer();
ToolbarHelper::custom('attendees.export', 'download', 'download', Text::_('COM_JEM_EXPORT'), false);
$eventid = $this->event->id;
$link_print = 'index.php?option=com_jem&amp;view=attendees&amp;layout=print&amp;tmpl=component&amp;eventid='.$eventid;
$bar = ToolBar::getInstance('toolbar');
$bar->appendButton('Popup', 'print', 'COM_JEM_PRINT', $link_print, 600, 300);
ToolbarHelper::deleteList('COM_JEM_CONFIRM_DELETE', 'attendees.remove', 'COM_JEM_ATTENDEES_DELETE');
ToolbarHelper::spacer();
ToolbarHelper::custom('attendees.back', 'back', 'back', Text::_('COM_JEM_ATT_BACK'), false);
ToolbarHelper::divider();
ToolbarHelper::help('registereduser', true);
}
}