Skip to content

Commit

Permalink
Task #133260 feat: Create a function to take the id of the default re…
Browse files Browse the repository at this point in the history
…port by the plugin name
  • Loading branch information
vaivk369 authored and coolbung committed Aug 31, 2018
1 parent 99ceb91 commit 791705b
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions tjreports/site/models/reports.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,10 @@ protected function populateState($ordering = '', $direction = 'ASC')

$colToshow = $input->get('colToshow', array(), 'ARRAY');

$reportId = $input->get('reportId', 0, 'uint');
$this->setState('reportId', $reportId);
if ($reportId = $input->get('reportId', 0, 'uint'))
{
$this->setState('reportId', $reportId);
}

$this->filterReportColumns($reportId, $colToshow);

Expand Down Expand Up @@ -915,6 +917,24 @@ public function getReportLink($reportToLink, $filters)
}
}

/**
* Method to get id of the report having default set as 1
*
* @param STRING $pluginName Plugin Name
*
* @return Integer
*
* @since 1.1.0
*/
public function getDefaultReport($pluginName)
{
JTable::addIncludePath(JPATH_ROOT . '/administrator/components/com_tjreports/tables');
$reportTable = JTable::getInstance('Tjreport', 'TjreportsTable', array('dbo', $db));
$reportTable->load(array('plugin' => $pluginName, 'default' => 1));

return $reportTable->id;
}

/**
* Method to get report plugin of particular type for inter linking
*
Expand Down

0 comments on commit 791705b

Please sign in to comment.