Skip to content

Commit

Permalink
Merge branch 'release-1.4.5' of github.com:techjoomla/com_tjfields in…
Browse files Browse the repository at this point in the history
…to Bug#154244
  • Loading branch information
Aishwarya committed Dec 16, 2019
2 parents 1b221ff + c883091 commit 374d997
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 53 deletions.
3 changes: 3 additions & 0 deletions admin_language/en-GB/en-GB.com_tjfields.ini
Original file line number Diff line number Diff line change
Expand Up @@ -530,3 +530,6 @@ COM_TJFIELDS_FORM_OPTIONS_NAME_LABEL="Text"
COM_TJFIELDS_FORM_OPTIONS_VALUE_LABEL="Value"
COM_TJFIELDS_FORM_OPTIONS_OPTIONID_LABEL="Option Id"
COM_TJFIELDS_FILE_DELETE_SUCCESS="File deleted successfully."

;Added in 1.4.5
COM_TJFIELDS_SEARCH_FILTER_SUBMIT="Search"
3 changes: 1 addition & 2 deletions administrator/models/fields/cluster.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ protected function getOptions()
// Create oprion for each cluster
foreach ($clusters as $cluster)
{
$options[] = HTMLHelper::_('select.option', $cluster->id, trim($cluster->name));
$options[] = HTMLHelper::_('select.option', $cluster->cluster_id, trim($cluster->name));
}

if (!$this->loadExternally)
Expand Down Expand Up @@ -123,7 +123,6 @@ protected function getInput()
if (!empty($clusterId))
{
$this->value = $clusterId;
$this->readonly = true;
}

return parent::getInput();
Expand Down
19 changes: 19 additions & 0 deletions administrator/models/forms/filter_groups.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<form>
<fields name="filter">
<field name="search"
type="text"
hint="COM_TJFIELDS_SEARCH_FILTER_SUBMIT"
label="COM_USERS_FILTER_SEARCH_DESC"
class="js-stools-search-string" />

<field name="state"
type="status"
label="COM_TJFIELDS_FILTER_STATE"
description="COM_TJFIELDS_FILTER_STATE_DESC"
onchange="this.form.submit();"
>
<option value="">JOPTION_SELECT_PUBLISHED</option>
</field>
</fields>
</form>
2 changes: 2 additions & 0 deletions administrator/models/options.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ protected function getListQuery()
$query->where('a.field_id = ' . (int) $fieldId);
}

$query->order($db->qn($db->escape($this->getState('list.ordering', 'a.options'))) . ' ' . $db->escape($this->getState('list.direction', 'ASC')));

return $query;
}

Expand Down
2 changes: 1 addition & 1 deletion administrator/models/rules/cluster.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function test(SimpleXMLElement $element, $value, $group = null, Registry
{
foreach ($clusters as $cluster)
{
if ($value == $cluster->id)
if ($value == $cluster->cluster_id)
{
return true;
}
Expand Down
58 changes: 19 additions & 39 deletions administrator/views/groups/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
// no direct access
defined('_JEXEC') or die;

use \Joomla\CMS\Layout\LayoutHelper;

JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
if(JVERSION >= '3.0')
{
Expand Down Expand Up @@ -70,34 +72,19 @@
}
</script>

<?php
//Joomla Component Creator code to allow adding non select list filters
if (!empty($this->extra_sidebar)) {
$this->sidebar .= $this->extra_sidebar;
}
?>
<form action="<?php echo JRoute::_('index.php?option=com_tjfields&view=groups&client='.$input->get('client','','STRING')); ?>" method="post" name="adminForm" id="adminForm">
<div class="techjoomla-bootstrap">
<?php if(!empty($this->sidebar)): ?>
<div id="j-sidebar-container" class="span2">
<?php echo $this->sidebar; ?>
</div>
<div id="j-main-container" class="span10">
<?php else : ?>
<div id="j-main-container">
<?php endif;?>
<div id="filter-bar" class="btn-toolbar">
<div class="filter-search btn-group pull-left">
<label for="filter_search" class="element-invisible"><?php echo JText::_('JSEARCH_FILTER');?></label>
<input type="text" name="filter_search" id="filter_search" placeholder="<?php echo JText::_('JSEARCH_FILTER'); ?>" value="<?php echo $this->escape($this->state->get('filter.search')); ?>" title="<?php echo JText::_('JSEARCH_FILTER'); ?>" />
</div>
<div class="btn-group pull-left">
<button class="btn hasTooltip" type="submit" title="<?php echo JText::_('JSEARCH_FILTER_SUBMIT'); ?>"><i class="icon-search"></i></button>
<button class="btn hasTooltip" type="button" title="<?php echo JText::_('JSEARCH_FILTER_CLEAR'); ?>" onclick="document.id('filter_search').value='';this.form.submit();"><i class="icon-remove"></i></button>
</div>

<?php if(JVERSION >= '3.0'):?>

<div class="techjoomla-bootstrap">
<?php if (!empty($this->sidebar)): ?>
<div id="j-sidebar-container" class="span2"><?php echo $this->sidebar; ?></div>
<div id="j-main-container" class="span10">
<?php else : ?>
<div id="j-main-container">
<?php endif; ?>
<div class="tjBs3">
<div class="btn-group pull-left">
<?php echo LayoutHelper::render('joomla.searchtools.default', array('view' => $this)); ?>
</div>
<?php if(JVERSION >= '3.0'):?>
<div class="btn-group pull-right hidden-phone">
<label for="limit" class="element-invisible"><?php echo JText::_('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC');?></label>
<?php echo $this->pagination->getLimitBox(); ?>
Expand All @@ -114,15 +101,13 @@

<div class="btn-group pull-right">
<label for="sortTable" class="element-invisible"><?php echo JText::_('JGLOBAL_SORT_BY');?></label>
<select name="sortTable" id="sortTable" class="input-medium" onchange="Joomla.orderTable()">
<option value=""><?php echo JText::_('JGLOBAL_SORT_BY');?></option>
<select name="sortTable" id="sortTable" class="input-medium" onchange="Joomla.orderTable()">
<option value=""><?php echo JText::_('JGLOBAL_SORT_BY');?></option>
<?php echo JHtml::_('select.options', $sortFields, 'value', 'text', $listOrder);?>
</select>
</select>
</div>

<?php endif;?>

</div>
<?php endif;?>
</div>
<div class="clearfix"> </div>
<?php
if (empty($this->items))
Expand Down Expand Up @@ -161,9 +146,6 @@
<th class='left'>
<?php echo JHtml::_('grid.sort', 'COM_TJFIELDS_GROUPS_CLIENT', 'a.client', $listDirn, $listOrder); ?>
</th>



<?php if (isset($this->items[0]->id)): ?>
<th width="1%" class="nowrap center hidden-phone">
<?php echo JHtml::_('grid.sort', 'JGRID_HEADING_ID', 'a.id', $listDirn, $listOrder); ?>
Expand Down Expand Up @@ -245,8 +227,6 @@
<?php echo $item->client; ?>
</td>



<?php if (isset($this->items[0]->id)): ?>
<td class="center hidden-phone">
<?php echo (int) $item->id; ?>
Expand Down
14 changes: 3 additions & 11 deletions administrator/views/groups/view.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ public function display($tpl = null)
$this->state = $this->get('State');
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->filterForm = $this->get('FilterForm');
$this->activeFilters = $this->get('ActiveFilters');

// Check for errors.
if (count($errors = $this->get('Errors')))
Expand Down Expand Up @@ -152,17 +154,7 @@ protected function addToolbar()
JToolBarHelper::preferences('com_tjfields');
}

$this->extra_sidebar = '';

if (JVERSION >= '3.0')
{
// Set sidebar action - New in 3.0
$filter_state = $this->state->get('filter.state');
$pub_text = JText::_('JOPTION_SELECT_PUBLISHED');
$publish_opt = JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), "value", "text", $filter_state, true);
JHtmlSidebar::setAction('index.php?option=com_tjfields&view=groups');
JHtmlSidebar::addFilter($pub_text, 'filter_published', $publish_opt);
}

}

/**
Expand Down

0 comments on commit 374d997

Please sign in to comment.