- Added methods deleteCustomFilter and _fillCustomFilters to controller InfoCenter

- Added method deleteCustomFilter to model Filters_model
- Changed parameter filterId to filter_id in FilterWidget, infocenterData
- Changed CSS and JS in views/widgets/navigationMenu.php to allow two links in one menu item
- Changed NavigationMenuWidget to allow two links in one menu item
This commit is contained in:
Paolo
2018-02-09 15:18:44 +01:00
parent 4dec69ae63
commit c57c953eaa
7 changed files with 119 additions and 46 deletions
@@ -11,9 +11,10 @@ class InfoCenter extends VileSci_Controller
// App and Verarbeitungstaetigkeit name for logging
const APP = 'infocenter';
const TAETIGKEIT = 'bewerbung';
const FILTER_ID = 'filter_id';
// URL prefix for this controller
const URL_PREFIX = '/system/infocenter/InfoCenter/';
const URL_PREFIX = '/system/infocenter/InfoCenter';
// Used to log with PersonLogLib
private $logparams = array(
@@ -165,7 +166,7 @@ class InfoCenter extends VileSci_Controller
)
);
redirect(self::URL_PREFIX.'showDetails/'.$person_id.'#DokPruef');
redirect(self::URL_PREFIX.'/showDetails/'.$person_id.'#DokPruef');
}
/**
@@ -337,7 +338,7 @@ class InfoCenter extends VileSci_Controller
$this->_log($person_id, 'savenotiz', array($titel));
redirect(self::URL_PREFIX.'showDetails/'.$person_id.'#NotizAkt');
redirect(self::URL_PREFIX.'/showDetails/'.$person_id.'#NotizAkt');
}
/**
@@ -368,6 +369,21 @@ class InfoCenter extends VileSci_Controller
->_display();
}
/**
*
*/
public function deleteCustomFilter()
{
$filter_id = $this->input->get('filter_id');
if (is_numeric($filter_id))
{
$this->FiltersModel->deleteCustomFilter($filter_id);
redirect(self::URL_PREFIX);
}
}
// -----------------------------------------------------------------------------------------------------------------
// Private methods
@@ -446,7 +462,7 @@ class InfoCenter extends VileSci_Controller
'children' => array()
);
$this->_fillFilters($listCustomFilters, $filtersarray['personal']);
$this->_fillCustomFilters($listCustomFilters, $filtersarray['personal']);
}
$this->navigationMenuArray = array(
@@ -471,12 +487,26 @@ class InfoCenter extends VileSci_Controller
{
$toPrint = "%s=%s";
$tofill['children'][] = array(
'link' => sprintf($toPrint, base_url('index.ci.php/system/infocenter/InfoCenter?filterId'), $filterId),
'link' => sprintf($toPrint, base_url('index.ci.php/system/infocenter/InfoCenter?filter_id'), $filterId),
'description' => $description
);
}
}
private function _fillCustomFilters($filters, &$tofill)
{
foreach ($filters as $filterId => $description)
{
$toPrint = "%s=%s";
$tofill['children'][] = array(
'link' => sprintf($toPrint, base_url('index.ci.php/system/infocenter/InfoCenter?filter_id'), $filterId),
'description' => $description,
'subscriptLink' => sprintf($toPrint, base_url('index.ci.php/system/infocenter/InfoCenter/deleteCustomFilter?filter_id'), $filterId),
'subscriptDescription' => 'Remove'
);
}
}
/**
* Loads all necessary Person data: Stammdaten (name, svnr, contact, ...), Dokumente, Logs and Notizen
* @param $person_id
@@ -627,7 +657,7 @@ class InfoCenter extends VileSci_Controller
$this->PrestudentModel->addSelect('person_id');
$person_id = $this->PrestudentModel->load($prestudent_id)->retval[0]->person_id;
redirect(self::URL_PREFIX.'showDetails/'.$person_id.'#'.$section);
redirect(self::URL_PREFIX.'/showDetails/'.$person_id.'#'.$section);
}
/**