Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ protected function getListQuery()

// Join over the categories.
$query->select($db->quoteName('c.title', 'category_title'))
->select($db->quoteName('c.published', 'category_published'))
->join(
'LEFT',
$db->quoteName('#__categories', 'c') . ' ON ' . $db->quoteName('c.id') . ' = ' . $db->quoteName('a.catid')
Expand Down
27 changes: 24 additions & 3 deletions administrator/components/com_contact/tmpl/contacts/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

defined('_JEXEC') or die;

use Joomla\CMS\Button\FeaturedButton;
use Joomla\CMS\Button\PublishedButton;
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Associations;
Expand Down Expand Up @@ -127,12 +129,28 @@
<?php endif; ?>
</td>
<td class="text-center">
<?php echo HTMLHelper::_('contactadministrator.featured', $item->featured, $i, $canChange); ?>
<?php
$options = [
'task_prefix' => 'contacts.',
'disabled' => !$canChange,
'id' => 'featured-' . $item->id
];

echo (new FeaturedButton())
->render((int) $item->featured, $i, $options);
?>
</td>
<td class="text-center">
<?php echo HTMLHelper::_('jgrid.published', $item->published, $i, 'contacts.', $canChange, 'cb', $item->publish_up, $item->publish_down); ?>
<?php
$options = [
'task_prefix' => 'contacts.',
'disabled' => !$canChange,
'id' => 'state-' . $item->id,
'category_published' => $item->category_published
];
echo (new PublishedButton())->render((int) $item->published, $i, $options, $item->publish_up, $item->publish_down);
?>
</td>

<th scope="row" class="has-context">
<div>
<?php if ($item->checked_out) : ?>
Expand All @@ -149,6 +167,9 @@
</div>
<div class="small">
<?php echo Text::_('JCATEGORY') . ': ' . $this->escape($item->category_title); ?>
<?php if ($item->category_published < '1') :
echo $item->category_published == '0' ? ' (' . Text::_('JUNPUBLISHED') . ')' : ' (' . Text::_('JTRASHED') . ')';
endif; ?>
</div>
</div>
</th>
Expand Down