mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-18 07:22:17 +00:00
- 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:
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* @license GPLv3
|
||||
* @since Version 1.0.0
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* FHC Helper
|
||||
*
|
||||
@@ -33,7 +33,7 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
function generateToken($length = 64)
|
||||
{
|
||||
// For PHP 7 you can use random_bytes()
|
||||
if(function_exists('random_bytes'))
|
||||
if(function_exists('random_bytes'))
|
||||
{
|
||||
$token = base64_encode(random_bytes($length));
|
||||
//base64 is about 33% longer, so we need to truncate the result
|
||||
@@ -41,7 +41,7 @@ function generateToken($length = 64)
|
||||
}
|
||||
|
||||
// for PHP >=5.3 and <7
|
||||
if(function_exists('openssl_random_pseudo_bytes'))
|
||||
if(function_exists('openssl_random_pseudo_bytes'))
|
||||
{
|
||||
$token = base64_encode(openssl_random_pseudo_bytes($length, $strong));
|
||||
// is the token strong enough?
|
||||
@@ -51,7 +51,7 @@ function generateToken($length = 64)
|
||||
|
||||
//fallback to mt_rand if php < 5.3 or no openssl available
|
||||
$characters = '0123456789';
|
||||
$characters .= 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz/+';
|
||||
$characters .= 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz/+';
|
||||
$charactersLength = strlen($characters)-1;
|
||||
$token = '';
|
||||
//select some random characters
|
||||
@@ -96,7 +96,7 @@ function loadResource($path, $resources = null, $subdir = false)
|
||||
{
|
||||
$path .= '/';
|
||||
}
|
||||
|
||||
|
||||
// Loads in $tmpResources all the given resources
|
||||
$tmpResources = $resources;
|
||||
if ($resources == null)
|
||||
@@ -107,7 +107,7 @@ function loadResource($path, $resources = null, $subdir = false)
|
||||
{
|
||||
$tmpResources = array($resources);
|
||||
}
|
||||
|
||||
|
||||
// Loads in $tmpPaths path and eventually the subdirectories
|
||||
$tmpPaths = array($path);
|
||||
// NOTE: Used @ to prevent ugly error messages
|
||||
@@ -133,7 +133,7 @@ function loadResource($path, $resources = null, $subdir = false)
|
||||
}
|
||||
closedir($dirHandler);
|
||||
}
|
||||
|
||||
|
||||
// Loops through the resources
|
||||
foreach($tmpResources as $tmpResource)
|
||||
{
|
||||
@@ -147,4 +147,4 @@ function loadResource($path, $resources = null, $subdir = false)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ class Filters_model extends DB_Model
|
||||
'filter_kurzbz ILIKE' => $filter_kurzbz
|
||||
);
|
||||
|
||||
return $this->FiltersModel->loadWhere($filterParametersArray);
|
||||
return $this->loadWhere($filterParametersArray);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -49,6 +49,14 @@ class Filters_model extends DB_Model
|
||||
'uid' => $uid
|
||||
);
|
||||
|
||||
return $this->FiltersModel->loadWhere($filterParametersArray);
|
||||
return $this->loadWhere($filterParametersArray);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function deleteCustomFilter($filter_id)
|
||||
{
|
||||
return $this->delete($filter_id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,8 +94,8 @@
|
||||
)
|
||||
ORDER BY "LastAction" DESC
|
||||
',
|
||||
'hideHeader' => true,
|
||||
'hideSave' => true,
|
||||
'hideHeader' => false,
|
||||
'hideSave' => false,
|
||||
'checkboxes' => array('PersonId'),
|
||||
'additionalColumns' => array('Details'),
|
||||
'formatRaw' => function($fieldName, $fieldValue, $datasetRaw) {
|
||||
@@ -139,11 +139,11 @@
|
||||
}
|
||||
);
|
||||
|
||||
$filterId = isset($_GET['filterId']) ? $_GET['filterId'] : null;
|
||||
$filterId = isset($_GET[InfoCenter::FILTER_ID]) ? $_GET[InfoCenter::FILTER_ID] : null;
|
||||
|
||||
if (isset($filterId) && is_numeric($filterId))
|
||||
{
|
||||
$filterWidgetArray['filterId'] = $filterId;
|
||||
$filterWidgetArray[InfoCenter::FILTER_ID] = $filterId;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<div class="navbar-default sidebar" role="navigation">
|
||||
<div class="sidebar-nav navbar-collapse">
|
||||
<ul class="nav" id="side-menu">
|
||||
<li id="collapseicon" class="text-right" style="cursor: pointer; color: #337ab7"><i
|
||||
class="fa fa-angle-double-left fa-fw"></i>
|
||||
<li id="collapseicon" class="text-right" style="cursor: pointer; color: #337ab7">
|
||||
<i class="fa fa-angle-double-left fa-fw"></i>
|
||||
</li>
|
||||
<?php NavigationMenuWidget::printNavigationMenu(); ?>
|
||||
</ul>
|
||||
@@ -10,7 +10,7 @@
|
||||
<i id="collapseinicon" class="fa fa-angle-double-right fa-fw"></i>
|
||||
</div>
|
||||
<style>
|
||||
#collapseinicon{
|
||||
#collapseinicon {
|
||||
display: none;
|
||||
cursor: pointer;
|
||||
color: #337ab7;
|
||||
@@ -22,25 +22,46 @@
|
||||
height: 20px;
|
||||
background-color: #F8F8F8;
|
||||
}
|
||||
|
||||
.nav > li > span {
|
||||
position: relative;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.nav > li > span > a {
|
||||
display: inline;
|
||||
padding-top: 10px;
|
||||
padding-bottom: 10px;
|
||||
padding-right: 123px;
|
||||
}
|
||||
|
||||
.menuSubscriptLink {
|
||||
font-size: 10px;
|
||||
padding-left: 0px !important;
|
||||
padding-right: 0px !important;
|
||||
}
|
||||
|
||||
.sidebar ul li span a.active {
|
||||
background-color: transparent;
|
||||
font-weight: bold;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
</style>
|
||||
<script>
|
||||
//hiding/showing navigation menu - works only with sb admin 2 template!!
|
||||
$("#collapseicon").click(
|
||||
function ()
|
||||
{
|
||||
$("#page-wrapper").css('margin-left', '0px');
|
||||
$("#side-menu").hide();
|
||||
$("#collapseinicon").show();
|
||||
}
|
||||
);
|
||||
|
||||
$("#collapseinicon").click(
|
||||
function ()
|
||||
{
|
||||
$("#page-wrapper").css('margin-left', '250px');
|
||||
$("#side-menu").show();
|
||||
$("#collapseinicon").hide();
|
||||
}
|
||||
);
|
||||
// Hiding/showing navigation menu - works only with sb admin 2 template!!
|
||||
|
||||
</script>
|
||||
$("#collapseicon").click(function() {
|
||||
$("#page-wrapper").css('margin-left', '0px');
|
||||
$("#side-menu").hide();
|
||||
$("#collapseinicon").show();
|
||||
});
|
||||
|
||||
$("#collapseinicon").click(function() {
|
||||
$("#page-wrapper").css('margin-left', '250px');
|
||||
$("#side-menu").show();
|
||||
$("#collapseinicon").hide();
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
@@ -8,7 +8,7 @@ class FilterWidget extends Widget
|
||||
const APP_PARAMETER = 'app';
|
||||
const DATASET_NAME_PARAMETER = 'datasetName';
|
||||
const FILTER_KURZBZ = 'filterKurzbz';
|
||||
const FILTER_ID = 'filterId';
|
||||
const FILTER_ID = 'filter_id';
|
||||
const QUERY_PARAMETER = 'query';
|
||||
const DB_RESULT = 'dbResult';
|
||||
const ADDITIONAL_COLUMNS = 'additionalColumns';
|
||||
|
||||
@@ -7,7 +7,7 @@ class NavigationMenuWidget extends Widget
|
||||
{
|
||||
private $navigationMenu;
|
||||
|
||||
private static $NavigationMenuWidgetInstance;
|
||||
private static $navigationMenuWidgetInstance;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -16,7 +16,7 @@ class NavigationMenuWidget extends Widget
|
||||
{
|
||||
$this->navigationMenu = $widgetData;
|
||||
|
||||
self::$NavigationMenuWidgetInstance = $this;
|
||||
self::$navigationMenuWidgetInstance = $this;
|
||||
|
||||
$this->view('widgets/navigationMenu');
|
||||
}
|
||||
@@ -26,7 +26,7 @@ class NavigationMenuWidget extends Widget
|
||||
*/
|
||||
public static function printNavigationMenu()
|
||||
{
|
||||
foreach (self::$NavigationMenuWidgetInstance->navigationMenu as $item)
|
||||
foreach (self::$navigationMenuWidgetInstance->navigationMenu as $item)
|
||||
{
|
||||
self::printNavItem($item);
|
||||
}
|
||||
@@ -41,6 +41,11 @@ class NavigationMenuWidget extends Widget
|
||||
|
||||
echo '<li class="'.$expanded.'">';
|
||||
|
||||
if (isset($item['subscriptLink']) && isset($item['subscriptDescription']))
|
||||
{
|
||||
echo '<span>';
|
||||
}
|
||||
|
||||
echo '<a href="'.$item['link'].'"'.$expanded.'>';
|
||||
|
||||
if (isset($item['icon']))
|
||||
@@ -48,7 +53,6 @@ class NavigationMenuWidget extends Widget
|
||||
echo '<i class="fa fa-'.$item['icon'].' fa-fw"></i> ';
|
||||
}
|
||||
|
||||
// echo '<span>'.$item['description'].'</span>'.'<span style="">test</span>';
|
||||
echo $item['description'];
|
||||
|
||||
if (!empty($item['children']))
|
||||
@@ -58,6 +62,16 @@ class NavigationMenuWidget extends Widget
|
||||
|
||||
echo '</a>';
|
||||
|
||||
if (isset($item['subscriptLink']) && isset($item['subscriptDescription']))
|
||||
{
|
||||
echo '<a class="menuSubscriptLink" href="'.$item['subscriptLink'].'">'.$item['subscriptDescription'].'</a>';
|
||||
}
|
||||
|
||||
if (isset($item['subscriptLink']) && isset($item['subscriptDescription']))
|
||||
{
|
||||
echo '</span>';
|
||||
}
|
||||
|
||||
if (!empty($item['children']))
|
||||
{
|
||||
$level = '';
|
||||
|
||||
Reference in New Issue
Block a user