| Current Path : /var/www/html/administrator/components/com_jchat/tmpl/meetings/ |
| Current File : /var/www/html/administrator/components/com_jchat/tmpl/meetings/default_list.php |
<?php
/**
* @package JCHAT::MEETINGS::administrator::components::com_jchat
* @subpackage views
* @subpackage meetings
* @subpackage tmpl
* @author Joomla! Extensions Store
* @copyright (C) 2024 - Joomla! Extensions Store
* @license GNU/GPLv2 http://www.gnu.org/licenses/gpl-2.0.html
*/
defined ( '_JEXEC' ) or die ( 'Restricted access' );
use Joomla\CMS\Language\Text;
use Joomla\CMS\Factory;
use Joomla\CMS\Uri\Uri;
use Joomla\CMS\HTML\HTMLHelper;
use JExtstore\Component\JChat\Administrator\Framework\Helpers\Html as JChatHelpersHtml;
// Ordering drag'n'drop management
$saveOrderingUrl = null;
if ($this->orders['order'] == 's.ordering') {
$saveOrderingUrl = 'index.php?option=com_jchat&task=meetings.saveOrder&format=json&ajax=1';
HTMLHelper::_('draggablelist.draggable');
}
?>
<form action="index.php" method="post" name="adminForm" id="adminForm">
<table class="full headerlist">
<tr>
<td class="left">
<div class="input-group">
<span class="input-group-text" aria-label="<?php echo Text::_('COM_JCHAT_FILTER');?>"><span class="icon-filter" aria-hidden="true"></span> <?php echo Text::_('COM_JCHAT_FILTER' ); ?>:</span>
<input type="text" name="search" id="search" value="<?php echo htmlspecialchars($this->searchword, ENT_COMPAT, 'UTF-8');?>" class="text_area"/>
</div>
<button class="btn btn-primary btn-sm" onclick="this.form.submit();"><?php echo Text::_('COM_JCHAT_GO' ); ?></button>
<button class="btn btn-primary btn-sm" onclick="document.getElementById('search').value='';this.form.submit();"><?php echo Text::_( 'COM_JCHAT_RESET' ); ?></button>
</td>
<td class="right d-flex justify-content-end">
<div class="input-group d-none d-md-inline-flex flex-end">
<span class="input-group-text" aria-label="<?php echo Text::_('COM_JCHAT_STATE');?>"><span class="icon-filter" aria-hidden="true"></span> <?php echo Text::_('COM_JCHAT_STATE' ); ?></span>
<label class="visually-hidden" for="filter_state"><?php echo Text::_('JLIB_HTML_SELECT_STATE');?></label>
<?php
echo $this->lists['state'];
?>
<label class="visually-hidden" for="limit"><?php echo Text::_('JGLOBAL_LIST_LIMIT');?></label>
<?php
echo $this->pagination->getLimitBox();
?>
</div>
</td>
</tr>
</table>
<table id="adminList" class="adminlist table table-striped table-hover">
<thead>
<tr>
<th style="width:1%">
<?php echo Text::_('COM_JCHAT_NUM' ); ?>
</th>
<th style="width:1%">
<input type="checkbox" name="checkall-toggle" value="" class="form-check-input" onclick="Joomla.checkAll(this);" />
</th>
<th style="width:20%" class="title">
<?php echo HTMLHelper::_('grid.sort', 'COM_JCHAT_NAME', 's.name', @$this->orders['order_Dir'], @$this->orders['order'], 'meetings.display'); ?>
</th>
<th class="title d-none d-md-table-cell">
<?php echo Text::_('COM_JCHAT_DESCRIPTION'); ?>
</th>
<th class="title d-none d-lg-table-cell">
<?php echo Text::_('COM_JCHAT_MEETINGS_PARTICIPANTS'); ?>
</th>
<th class="title d-none d-md-table-cell">
<?php echo HTMLHelper::_('grid.sort', 'COM_JCHAT_MEETINGS_STARTDATE', 's.start_datetime', @$this->orders['order_Dir'], @$this->orders['order'], 'meetings.display'); ?>
</th>
<th class="title d-none d-md-table-cell">
<?php echo HTMLHelper::_('grid.sort', 'COM_JCHAT_MEETINGS_ENDDATE', 's.end_datetime', @$this->orders['order_Dir'], @$this->orders['order'], 'meetings.display'); ?>
</th>
<th class="order d-none d-md-table-cell">
<?php echo HTMLHelper::_('grid.sort', 'COM_JCHAT_ORDER', 's.ordering', @$this->orders['order_Dir'], @$this->orders['order'], 'meetings.display'); ?>
<?php
if(isset($this->orders['order']) && $this->orders['order'] == 's.ordering'):
echo JChatHelpersHtml::order($this->items, 'filesave.png', 'meetings.saveOrder');
endif;
?>
</th>
<th style="width:5%">
<?php echo HTMLHelper::_('grid.sort', 'COM_JCHAT_PUBLISHED', 's.published', @$this->orders['order_Dir'], @$this->orders['order'], 'meetings.display' ); ?>
</th>
<th style="width:5%">
<?php echo HTMLHelper::_('grid.sort', 'COM_JCHAT_ID', 's.id', @$this->orders['order_Dir'], @$this->orders['order'], 'meetings.display' ); ?>
</th>
</tr>
</thead>
<tbody <?php if ($saveOrderingUrl) :?> class="js-draggable" data-url="<?php echo $saveOrderingUrl; ?>" data-direction="<?php echo strtolower($this->orders['order_Dir']); ?>" <?php endif; ?>>
<?php
$k = 0;
$canCheckin = $this->user->authorise('core.manage', 'com_checkin');
for ($i=0, $n=count( $this->items ); $i < $n; $i++) {
$row = $this->items[$i];
$link = 'index.php?option=com_jchat&task=meetings.editEntity&cid[]='. $row->id ;
$taskPublishing = !$row->published ? 'meetings.publish' : 'meetings.unpublish';
$altPublishing = !$row->published ? Text::_( 'Publish' ) : Text::_( 'Unpublish' );
$published = '<a href="javascript:void(0);" onclick="return Joomla.listItemTask(\'cb' . $i . '\',\'' . $taskPublishing . '\')">';
$published .= $row->published ?
'<img alt="' . $altPublishing . '" src="' . Uri::base(true) . '/components/com_jchat/images/icon-16-tick.png" width="16" height="16"/>' :
'<img alt="' . $altPublishing . '" src="' . Uri::base(true) . '/components/com_jchat/images/publish_x.png" width="16" height="16"/>' ;
$published .= '</a>';
$checked = null;
// Access check.
if($this->user->authorise('core.edit', 'com_jchat')) {
$checked = $row->checked_out && $row->checked_out != $this->user->id ?
HTMLHelper::_('jgrid.checkedout', $i, Factory::getContainer()->get(\Joomla\CMS\User\UserFactoryInterface::class)->loadUserById($row->checked_out)->name, $row->checked_out_time, 'meetings.', $canCheckin) . '<input type="checkbox" style="display:none" data-enabled="false" id="cb' . $i . '" name="cid[]" value="' . $row->id . '"/>':
HTMLHelper::_('grid.id', $i, $row->id);
} else {
$checked = '<input type="checkbox" style="display:none" data-enabled="false" id="cb' . $i . '" name="cid[]" value="' . $row->id . '"/>';
}
?>
<tr>
<td style="width:1%">
<?php echo $this->pagination->getRowOffset($i); ?>
</td>
<td style="width:1%">
<?php echo $checked; ?>
</td>
<td class="sortable-adminlist-large">
<?php
// Access check.
if ( ($row->checked_out && ( $row->checked_out != $this->user->id)) || !$this->user->authorise('core.edit', 'com_jchat') ) {
echo $row->name;
} else {
?>
<a href="<?php echo $link; ?>" title="<?php echo Text::_('COM_JCHAT_EDIT_MEETING' ); ?>">
<span class='fas fa-pen-square' aria-hidden='true'></span>
<?php echo $row->name; ?>
</a>
<?php
}
?>
</td>
<td class="d-none d-md-table-cell sortable-adminlist-medium">
<?php echo $row->description; ?>
</td>
<td class="d-none d-lg-table-cell sortable-adminlist-large">
<?php
if($row->participants):
$participants = explode(',', $row->participants);
foreach ($participants as $singleParticipant) {
echo '<span class="badge bg-primary mb-1">' . $singleParticipant . '</span> ';
}
else:
?>
-
<?php endif;?>
</td>
<td class="d-none d-md-table-cell sortable-adminlist-medium">
<?php echo HTMLHelper::_('date', $row->start_datetime, Text::_('DATE_FORMAT_LC6')); ?>
</td>
<td class="d-none d-md-table-cell sortable-adminlist-medium">
<?php echo HTMLHelper::_('date', $row->end_datetime, Text::_('DATE_FORMAT_LC6')); ?>
</td>
<td class="order d-none d-md-table-cell sortable-adminlist-small">
<?php
$ordering = $this->orders['order'] == 's.ordering';
$disabled = $ordering ? '' : 'disabled="disabled"';
$iconClass = '';
if (!$ordering) {
$iconClass = ' inactive tip-top hasTooltip" title="' . HTMLHelper::tooltipText('JORDERINGDISABLED');
}
?>
<div style="display:inline-block" class="sortable-handler<?php echo $iconClass ?>">
<span class="icon-menu" aria-hidden="true"></span>
</div>
<span class="moveup" aria-hidden="true"><?php echo $this->pagination->orderUpIcon( $i, true, 'meetings.moveorder_up', 'COM_JCHAT_MOVE_UP', $ordering); ?></span>
<span class="movedown" aria-hidden="true"><?php echo $this->pagination->orderDownIcon( $i, $n, true, 'meetings.moveorder_down', 'COM_JCHAT_MOVE_DOWN', $ordering); ?></span>
<input type="text" name="order[]" size="5" value="<?php echo $row->ordering; ?>" <?php echo $disabled; ?> class="ordering_input" style="text-align: center" />
</td>
<td>
<?php echo $published;?>
</td>
<td>
<?php echo $row->id; ?>
</td>
</tr>
<?php
}
?>
<tfoot>
<td colspan="100%">
<?php echo $this->pagination->getListFooter(); ?>
</td>
</tfoot>
</table>
<input type="hidden" name="section" value="view" />
<input type="hidden" name="option" value="<?php echo $this->option;?>" />
<input type="hidden" name="task" value="meetings.display" />
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="filter_order" value="<?php echo @$this->orders['order'];?>" />
<input type="hidden" name="filter_order_Dir" value="<?php echo @$this->orders['order_Dir'];?>" />
</form>