Skip to content

Commit

Permalink
[K6.3] Change: deprecate statistics view and remove it from kunena me…
Browse files Browse the repository at this point in the history
…nu (Kunena#9638)

* Change: deprecate statistics view and remove it from kunena menu

* [K6.3] Refactor log clean view into modal making log controller / model / vi… (Kunena#9637)

* Refactor log clean view into modal making log controller / model / view obsolete

* Refactor log clean view into modal making log controller / model / view obsolete

* Change: deprecate statistics view and remove it from kunena menu
  • Loading branch information
Ruud68 authored Feb 29, 2024
1 parent edd8241 commit 864a9c6
Show file tree
Hide file tree
Showing 5 changed files with 107 additions and 104 deletions.
19 changes: 13 additions & 6 deletions src/admin/kunena.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<?xml version="1.0" encoding="utf-8"?><!DOCTYPE extension>
<extension type="component" version="4.0" method="upgrade">
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE extension>
<extension
type="component"
version="4.0"
method="upgrade">
<name>com_kunena</name>
<version>@kunenaversion@</version>
<versionname>@kunenaversionname@</versionname>
Expand All @@ -14,7 +18,9 @@
<changelogurl>@kunenachangelog@</changelogurl>
<install>
<sql>
<file driver="mysql" charset="utf8">sql/install/mysql/create_tables.utf8.sql</file>
<file
driver="mysql"
charset="utf8">sql/install/mysql/create_tables.utf8.sql</file>
</sql>
</install>
<files folder="site">
Expand All @@ -25,7 +31,9 @@
<filename>jomsocial_rule.xml</filename>
</files>
<administration>
<menu view="cpanel" img="components/com_kunena/media/icons/favicons/kunena-logo-white.png">COM_KUNENA
<menu
view="cpanel"
img="components/com_kunena/media/icons/favicons/kunena-logo-white.png">COM_KUNENA
</menu>
<submenu>
<menu view="cpanel">COM_KUNENA_DASHBOARD</menu>
Expand All @@ -38,7 +46,6 @@
<menu view="config">COM_KUNENA_CONFIGURATION</menu>
<menu view="plugins">COM_KUNENA_PLUGIN_MANAGER</menu>
<menu view="logs">COM_KUNENA_LOG_MANAGER</menu>
<menu view="statistics">COM_KUNENA_MENU_STATISTICS</menu>
<menu view="tools">COM_KUNENA_FORUM_TOOLS</menu>
<menu view="trashs">COM_KUNENA_TRASH_MANAGER</menu>
</submenu>
Expand All @@ -57,4 +64,4 @@
<filename>config.xml</filename>
</files>
</administration>
</extension>
</extension>
2 changes: 2 additions & 0 deletions src/admin/src/Controller/StatisticsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
* Kunena Backend Statistics Controller
*
* @since Kunena 5.0
*
* @deprecated Kunena 6.3 will be removed in Kunena 7.0 without replacement
*/
class StatisticsController extends FormController
{
Expand Down
2 changes: 2 additions & 0 deletions src/admin/src/Model/StatisticsModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
* Statistics Model for Kunena
*
* @since 5.0
*
* @deprecated Kunena 6.3 will be removed in Kunena 7.0 without replacement
*/
class StatisticsModel extends ListModel
{
Expand Down
2 changes: 2 additions & 0 deletions src/admin/src/View/Statistics/HtmlView.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* @copyright Copyright (C) 2008 - 2024 Kunena Team. All rights reserved.
* @license https://www.gnu.org/copyleft/gpl.html GNU/GPL
* @link https://www.kunena.org
*
* @deprecated Kunena 6.3 will be removed in Kunena 7.0 without replacement
**/

namespace Kunena\Forum\Administrator\View\Statistics;
Expand Down
186 changes: 88 additions & 98 deletions src/admin/tmpl/statistics/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* @copyright Copyright (C) 2008 - 2024 Kunena Team. All rights reserved.
* @license https://www.gnu.org/copyleft/gpl.html GNU/GPL
* @link https://www.kunena.org
*
* @deprecated Kunena 6.3 will be removed in Kunena 7.0 without replacement
**/

defined('_JEXEC') or die();
Expand All @@ -22,7 +24,7 @@
?>

<script type="text/javascript">
Joomla.orderTable = function () {
Joomla.orderTable = function() {
table = document.getElementById("sortTable");
direction = document.getElementById("directionTable");
order = table.options[table.selectedIndex].value;
Expand All @@ -39,13 +41,11 @@
<div class="row">
<div id="j-main-container" class="col-md-12" role="main">
<div class="card card-block bg-faded p-2">
<form action="<?php echo KunenaRoute::_('administrator/index.php?option=com_kunena&view=statistics'); ?>"
method="post" name="adminForm"
id="adminForm">
<input type="hidden" name="task" value=""/>
<input type="hidden" name="boxchecked" value="0"/>
<input type="hidden" name="filter_order" value="<?php echo $this->list->Ordering; ?>"/>
<input type="hidden" name="filter_order_Dir" value="<?php echo $this->list->Direction; ?>"/>
<form action="<?php echo KunenaRoute::_('administrator/index.php?option=com_kunena&view=statistics'); ?>" method="post" name="adminForm" id="adminForm">
<input type="hidden" name="task" value="" />
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="filter_order" value="<?php echo $this->list->Ordering; ?>" />
<input type="hidden" name="filter_order_Dir" value="<?php echo $this->list->Direction; ?>" />
<?php echo HTMLHelper::_('form.token'); ?>

<div id="filter-bar" class="btn-toolbar">
Expand All @@ -54,33 +54,24 @@
<?php echo HTMLHelper::calendar($this->filter->TimeStop, 'filter_time_stop', 'filter_time_stop', '%Y-%m-%d', ['class' => 'filter btn-wrapper', 'placeholder' => Text::_('COM_KUNENA_STATISTICS_END_DATE')]); ?>
</div>
<div class="btn-group pull-left">
<button class="btn btn-outline-primary tip" type="submit"
title="<?php echo Text::_('COM_KUNENA_SYS_BUTTON_FILTERSUBMIT'); ?>"><i
class="icon-search"></i> <?php echo Text::_('COM_KUNENA_SYS_BUTTON_FILTERSUBMIT') ?>
<button class="btn btn-outline-primary tip" type="submit" title="<?php echo Text::_('COM_KUNENA_SYS_BUTTON_FILTERSUBMIT'); ?>"><i class="icon-search"></i> <?php echo Text::_('COM_KUNENA_SYS_BUTTON_FILTERSUBMIT') ?>
</button>
<button class="btn btn-outline-primary tip" type="button"
title="<?php echo Text::_('COM_KUNENA_SYS_BUTTON_FILTERRESET'); ?>"
onclick="jQuery('.filter').val('');jQuery('#adminForm').submit();"><i
class="icon-remove"></i> <?php echo Text::_('COM_KUNENA_SYS_BUTTON_FILTERRESET'); ?>
<button class="btn btn-outline-primary tip" type="button" title="<?php echo Text::_('COM_KUNENA_SYS_BUTTON_FILTERRESET'); ?>" onclick="jQuery('.filter').val('');jQuery('#adminForm').submit();"><i class="icon-remove"></i> <?php echo Text::_('COM_KUNENA_SYS_BUTTON_FILTERRESET'); ?>
</button>
</div>
<div class="btn-group pull-right d-none d-md-block">
<label for="limit"
class="element-invisible"><?php echo Text::_('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC'); ?></label>
<label for="limit" class="element-invisible"><?php echo Text::_('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC'); ?></label>
<?php echo $this->pagination->getLimitBox(); ?>
</div>
<div class="btn-group pull-right d-none d-md-block">
<label for="directionTable"
class="element-invisible"><?php echo Text::_('JFIELD_ORDERING_DESC'); ?></label>
<select name="directionTable" id="directionTable" class="input-medium"
onchange="Joomla.orderTable()">
<label for="directionTable" class="element-invisible"><?php echo Text::_('JFIELD_ORDERING_DESC'); ?></label>
<select name="directionTable" id="directionTable" class="input-medium" onchange="Joomla.orderTable()">
<option value=""><?php echo Text::_('JFIELD_ORDERING_DESC'); ?></option>
<?php echo HTMLHelper::_('select.options', $this->sortDirectionFields, 'value', 'text', $this->list->Direction); ?>
</select>
</div>
<div class="btn-group pull-right">
<label for="sortTable"
class="element-invisible"><?php echo Text::_('JGLOBAL_SORT_BY'); ?></label>
<label for="sortTable" class="element-invisible"><?php echo Text::_('JGLOBAL_SORT_BY'); ?></label>
<select name="sortTable" id="sortTable" class="input-medium" onchange="Joomla.orderTable()">
<option value=""><?php echo Text::_('JGLOBAL_SORT_BY'); ?></option>
<?php echo HTMLHelper::_('select.options', $this->sortFields, 'value', 'text', $this->list->Ordering); ?>
Expand All @@ -91,89 +82,88 @@ class="element-invisible"><?php echo Text::_('JGLOBAL_SORT_BY'); ?></label>

<table class="table table-striped" id="logList">
<thead>
<tr>
<th class="">
<?php echo Text::_('COM_KUNENA_STATISTICS_NAME') ?>
</th>
<th class="">
<?php echo Text::_('COM_KUNENA_STATISTICS_USERNAME') ?>
<small>(id)</small>
</th>
<th class="center">
<?php echo Text::_('COM_KUNENA_STATISTICS_POSTS') ?>
</th>
<th class="center">
<?php echo Text::_('COM_KUNENA_STATISTICS_MOVES') ?>
</th>
<th class="center">
<?php echo Text::_('COM_KUNENA_STATISTICS_EDITS') ?>
</th>
<th class="center">
<?php echo Text::_('COM_KUNENA_STATISTICS_DELETES') ?>
</th>
<th class="center">
<?php echo Text::_('COM_KUNENA_STATISTICS_THANK_YOU') ?>
</th>
</tr>
<tr>
<th class="">
<?php echo Text::_('COM_KUNENA_STATISTICS_NAME') ?>
</th>
<th class="">
<?php echo Text::_('COM_KUNENA_STATISTICS_USERNAME') ?>
<small>(id)</small>
</th>
<th class="center">
<?php echo Text::_('COM_KUNENA_STATISTICS_POSTS') ?>
</th>
<th class="center">
<?php echo Text::_('COM_KUNENA_STATISTICS_MOVES') ?>
</th>
<th class="center">
<?php echo Text::_('COM_KUNENA_STATISTICS_EDITS') ?>
</th>
<th class="center">
<?php echo Text::_('COM_KUNENA_STATISTICS_DELETES') ?>
</th>
<th class="center">
<?php echo Text::_('COM_KUNENA_STATISTICS_THANK_YOU') ?>
</th>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="10">
<?php echo $this->pagination->getListFooter(); ?>
</td>
</tr>
<tr>
<td colspan="10">
<?php echo $this->pagination->getListFooter(); ?>
</td>
</tr>
</tfoot>
<tbody>
<?php
$i = 0;
<?php
$i = 0;

if ($this->pagination->total > 0) :
foreach ($this->items as $item) :
$user = KunenaUserHelper::get($item->user_id);
if ($this->pagination->total > 0) :
foreach ($this->items as $item) :
$user = KunenaUserHelper::get($item->user_id);
?>
<tr>
<td>
<?php echo $this->escape($user->name); ?>
</td>
<td>
<?php echo $this->escape($user->username) . ' <small>(' . $this->escape($item->user_id) . ')</small>'; ?>
</td>
<td class="center">
<?php echo (int) $item->posts; ?>
</td>
<td class="center">
<?php echo (int) $item->moves; ?>
</td>
<td class="center">
<?php echo (int) $item->edits; ?>
</td>
<td class="center">
<?php echo (int) $item->deletes; ?>
</td>
<td class="center">
<?php echo (int) $item->thanks; ?>
</td>
</tr>
<?php
$i++;
endforeach;
else :
?>
<tr>
<td>
<?php echo $this->escape($user->name); ?>
</td>
<td>
<?php echo $this->escape($user->username) . ' <small>(' . $this->escape($item->user_id) . ')</small>'; ?>
</td>
<td class="center">
<?php echo (int) $item->posts; ?>
</td>
<td class="center">
<?php echo (int) $item->moves; ?>
</td>
<td class="center">
<?php echo (int) $item->edits; ?>
</td>
<td class="center">
<?php echo (int) $item->deletes; ?>
</td>
<td class="center">
<?php echo (int) $item->thanks; ?>
<td colspan="10">
<div class="card card-block bg-faded p-2 center filter-state">
<span><?php echo Text::_('COM_KUNENA_FILTERACTIVE'); ?>
<?php
if ($this->filter->Active) :
?>
<button class="btn btn-outline-primary" type="button" onclick="document.getElements('.filter').set('value', '');this.form.submit();"><?php echo Text::_('COM_KUNENA_FIELD_LABEL_FILTERCLEAR'); ?></button>
<?php endif; ?>
</span>
</div>
</td>
</tr>
<?php
$i++;
endforeach;
else :
?>
<tr>
<td colspan="10">
<div class="card card-block bg-faded p-2 center filter-state">
<span><?php echo Text::_('COM_KUNENA_FILTERACTIVE'); ?>
<?php
if ($this->filter->Active) :
?>
<button class="btn btn-outline-primary" type="button"
onclick="document.getElements('.filter').set('value', '');this.form.submit();"><?php echo Text::_('COM_KUNENA_FIELD_LABEL_FILTERCLEAR'); ?></button>
<?php endif; ?>
</span>
</div>
</td>
</tr>
<?php endif; ?>
<?php endif; ?>
</tbody>
</table>
</form>
Expand All @@ -184,4 +174,4 @@ class="element-invisible"><?php echo Text::_('JGLOBAL_SORT_BY'); ?></label>
<div class="pull-right small">
<?php echo KunenaVersion::getLongVersionHTML(); ?>
</div>
</div>
</div>

0 comments on commit 864a9c6

Please sign in to comment.