Unlocking in Infocenter now always reloads the Dataset and jumps to the correct Filter

This commit is contained in:
Andreas Österreicher
2019-04-17 09:15:41 +02:00
parent ed7f3f90fb
commit f05ebf3946
5 changed files with 32 additions and 5 deletions
@@ -207,6 +207,7 @@ class InfoCenter extends Auth_Controller
$data[self::FHC_CONTROLLER_ID] = $this->getControllerId();
$data[self::ORIGIN_PAGE] = $origin_page;
$data[self::PREV_FILTER_ID] = $this->input->get(self::PREV_FILTER_ID);
$this->load->view('system/infocenter/infocenterDetails.php', $data);
}
@@ -222,7 +223,18 @@ class InfoCenter extends Auth_Controller
if (isError($result))
show_error($result->retval);
redirect('/'.self::INFOCENTER_URI.'?'.self::FHC_CONTROLLER_ID.'='.$this->getControllerId());
$redirectLink = '/'.self::INFOCENTER_URI.'?'.self::FHC_CONTROLLER_ID.'='.$this->getControllerId();
// Force reload of Dataset after Unlock
$redirectLink .= '&reloadDataset=true';
$currentFilterId = $this->input->get(self::FILTER_ID);
if (isset($currentFilterId))
{
$redirectLink .= '&'.self::FILTER_ID.'='.$currentFilterId;
}
redirect($redirectLink);
}
/**
+1
View File
@@ -35,6 +35,7 @@ class FiltersLib
const APP_PARAMETER = 'app';
const DATASET_NAME_PARAMETER = 'datasetName';
const FILTER_KURZBZ_PARAMETER = 'filterKurzbz';
const DATASET_RELOAD_PARAMETER = 'reloadDataset';
// ...to specify permissions that are needed to use this FilterWidget
const REQUIRED_PERMISSIONS_PARAMETER = 'requiredPermissions';
@@ -256,6 +256,7 @@
'filter_id' => $this->input->get('filter_id'),
'requiredPermissions' => 'infocenter',
'datasetRepresentation' => 'tablesorter',
'reloadDataset' => ($this->input->get('reloadDataset')=='true'?true:false),
'customMenu' => true,
'checkboxes' => 'PersonId',
'additionalColumns' => array('Details'),
@@ -68,9 +68,13 @@
if (isset($lockedby)):
echo $this->p->t('global', 'wirdBearbeitetVon').': ';
echo $lockedby;
if ($origin_page == 'index'): ?>
if ($origin_page == 'index'):
$unlockpath = 'unlockPerson/'.$stammdaten->person_id;
$unlockpath .= '?fhc_controller_id='.$fhc_controller_id;
$unlockpath .= '&filter_id='.$prev_filter_id;
?>
  
<a href="unlockPerson/<?php echo $stammdaten->person_id; ?>">
<a href="<?php echo $unlockpath; ?>">
<i class="fa fa-sign-out"></i>&nbsp;<?php echo ucfirst($this->p->t('ui', 'freigeben')) ?>
</a>
<?php endif; ?>
+11 -2
View File
@@ -48,6 +48,7 @@ class FilterWidget extends Widget
private $_datasetRepresentation; // dataset representation (ex: tablesorter, pivotUI, ...)
private $_datasetRepresentationOptions; // dataset representation options for tablesorter, pivotUI, ...
private $_reloadDataset; // Force Reload of Dataset
private static $_FilterWidgetInstance; // static property that contains the instance of itself
@@ -156,6 +157,7 @@ class FilterWidget extends Widget
$this->_datasetName = null;
$this->_filterKurzbz = null;
$this->_filterId = null;
$this->_reloadDataset = null;
$this->_query = null;
$this->_additionalColumns = null;
$this->_columnsAliases = null;
@@ -201,6 +203,11 @@ class FilterWidget extends Widget
$this->_query = $args[FiltersLib::QUERY_PARAMETER];
}
if (isset($args[FiltersLib::DATASET_RELOAD_PARAMETER]))
{
$this->_reloadDataset = $args[FiltersLib::DATASET_RELOAD_PARAMETER];
}
// Parameter is used to add extra columns to the dataset
if (isset($args[FiltersLib::ADDITIONAL_COLUMNS])
&& is_array($args[FiltersLib::ADDITIONAL_COLUMNS])
@@ -334,8 +341,10 @@ class FilterWidget extends Widget
else // else if the filter loaded in session is the same that is being requested
{
// Get SESSION_RELOAD_DATASET from the session
$reloadDataset = $this->filterslib->getElementSession(FiltersLib::SESSION_RELOAD_DATASET);
if ($reloadDataset === true) // if it's value is very true then reload the dataset
$sessionReloadDataset = $this->filterslib->getElementSession(FiltersLib::SESSION_RELOAD_DATASET);
// if Filter changed or reload is forced by parameter then reload the Dataset
if ($this->_reloadDataset === true || $sessionReloadDataset === true)
{
// Set as false to stop changing the dataset
$this->filterslib->setElementSession(FiltersLib::SESSION_RELOAD_DATASET, false);