Skip to content

Commit

Permalink
Merge pull request #232 from apghalsasi25/Bug#154244
Browse files Browse the repository at this point in the history
Bug #231 fix: backend>> The title of form view of field group is not …
  • Loading branch information
ankush-maherwal authored Dec 16, 2019
2 parents 7f4859c + 0df8d3f commit 0dca716
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 30 deletions.
20 changes: 16 additions & 4 deletions admin_language/en-GB/en-GB.com_tjfields.ini
Original file line number Diff line number Diff line change
Expand Up @@ -339,13 +339,25 @@ COM_TJFIELDS_FORM_DESC_CITY_CITY_JTEXT="Enter City Language Constant"
COM_TJFIELDS_FORM_DESC_CITY_CITY_JTEXT_HELP="*You will need to add this constant in the language file you are using. <br/>English language file for city names is located at - YOUR_SITE/language/en-GB/en-GB.tjgeo.city.ini<br/>e.g. Add this in language file-<br/>TJ_GEO_CITY_NEWYORK="_QQ_"New York"_QQ_""
COM_TJFIELDS_FILTER_SELECT_REGION="- Select Region"
COM_TJFIELDS_CITY_EXISTS_IN_REGION_COUNTRY="Another city with same name exists in selcted country and region."
COM_TJLMS_COMPONENT="LMS"
COM_JTICKETING_COMPONENT="Ticketing"
COM_TJUCM_COMPONENT="UCM"

COM_TJFIELDS_COMPONENT="Fields"
COM_TJFIELDS_TITLE_FIELD="Types - Fields"
COM_TJFIELDS_TITLE_GROUPS="Types - Field Groups"

COM_TJFIELDS_PAGE_ADD_GROUP ="Types - New Field Group"
COM_TJFIELDS_PAGE_EDIT_GROUP ="Types - Edit Field Group"
COM_TJFIELDS_PAGE_ADD_FIELD ="Types - New Field"
COM_TJFIELDS_PAGE_EDIT_FIELD ="Types - Edit Field"

COM_TJFIELDS_TITLE_COMPONENT="Fields"
COM_TJFIELDS_TITLE_COMPONENT_GROUPS="Field Groups"
COM_TJFIELDS_ADD_GROUP=" Add new field group"
COM_TJFIELDS_EDIT_GROUP=" Edit field group"
COM_TJFIELDS_ADD_FIELD=" Add new field"
COM_TJFIELDS_EDIT_FIELD=" Edit field"
COM_TJFIELDS_ADD_GROUP="Field Group: Add"
COM_TJFIELDS_EDIT_GROUP="Field Group: Edit"
COM_TJFIELDS_ADD_FIELD="Field: Add"
COM_TJFIELDS_EDIT_FIELD="Field: Edit"
COM_TJFIELDS_GROUP_TITLE_ALREADY_EXISTS="Field group with same name already exists"

;validation
Expand Down
37 changes: 16 additions & 21 deletions administrator/views/group/view.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,37 +75,32 @@ protected function addToolbar()
$checkedOut = false;
}

$component_title = JText::_('COM_TJFIELDS_TITLE_COMPONENT');
// $component_title = JText::_('COM_TJFIELDS_TITLE_COMPONENT');

if (!empty($client))
{
$client = explode('.', $client);

if ($client['0'] == 'com_jticketing')
switch ($client['0'])
{
$component_title = JText::_('COM_JTICKETING_COMPONENT');
case 'com_jticketing' :
$component_title = JText::_('COM_JTICKETING_COMPONENT');
break;
case 'com_tjlms':
$component_title = JText::_('COM_TJLMS_COMPONENT');
break;
case 'com_tjucm':
$component_title = JText::_('COM_TJUCM_COMPONENT');
}
}

$canDo = TjfieldsHelper::getActions($client['0'], 'group');
JToolbarHelper::title(
$component_title . ": " .
JText::_('COM_TJFIELDS_PAGE_' . ($checkedOut ? 'VIEW_GROUP' : ($isNew ? 'ADD_GROUP' : 'EDIT_GROUP'))),
'pencil-2 article-add'
);

if ($isNew)
{
$viewTitle = JText::_('COM_TJFIELDS_ADD_GROUP');
}
else
{
$viewTitle = JText::_('COM_TJFIELDS_EDIT_GROUP');
}

if (JVERSION >= '3.0')
{
JToolbarHelper::title($component_title . $viewTitle, 'pencil-2');
}
else
{
JToolbarHelper::title($component_title . $viewTitle, 'group.png');
}
$canDo = TjfieldsHelper::getActions($client['0'], 'group');

// If not checked out, can save the item.
if (!$checkedOut && ($canDo->get('core.edit') || ($canDo->get('core.create'))))
Expand Down
10 changes: 5 additions & 5 deletions administrator/views/groups/view.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function display($tpl = null)
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->filterForm = $this->get('FilterForm');
$this->activeFilters = $this->get('ActiveFilters');
$this->activeFilters = $this->get('ActiveFilters');

// Check for errors.
if (count($errors = $this->get('Errors')))
Expand Down Expand Up @@ -86,6 +86,8 @@ protected function addToolbar()
case 'com_tjlms':
$component_title = JText::_('COM_TJLMS_COMPONENT');
break;
case 'com_tjucm':
$component_title = JText::_('COM_TJUCM_COMPONENT');
}
}

Expand All @@ -95,10 +97,10 @@ protected function addToolbar()
}

$state = $this->get('State');
$tjfieldsHelper = new TjfieldsHelper();
$tjfieldsHelper = new TjfieldsHelper;

$canDo = $tjfieldsHelper->getActions($client[0], 'group');
JToolBarHelper::title($component_title . JText::_('COM_TJFIELDS_TITLE_GROUPS'), 'list.png');
JToolBarHelper::title($component_title . ": " . JText::_('COM_TJFIELDS_TITLE_GROUPS'), 'list.png');

// Check if the form exists before showing the add/edit buttons
$formPath = JPATH_COMPONENT_ADMINISTRATOR . '/views/group';
Expand Down Expand Up @@ -150,8 +152,6 @@ protected function addToolbar()
{
JToolBarHelper::preferences('com_tjfields');
}


}

/**
Expand Down

0 comments on commit 0dca716

Please sign in to comment.