From b480ec30a269b1ff52cc4527aa15c704210964b2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20=C3=96sterreicher?=
Date: Thu, 8 Feb 2018 17:32:41 +0100
Subject: [PATCH 01/10] Handled Errors if there are no Filters
---
application/controllers/system/infocenter/InfoCenter.php | 3 +++
1 file changed, 3 insertions(+)
diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php
index 6e08c1b57..5c07c3027 100644
--- a/application/controllers/system/infocenter/InfoCenter.php
+++ b/application/controllers/system/infocenter/InfoCenter.php
@@ -386,6 +386,9 @@ class InfoCenter extends VileSci_Controller
*/
private function _setNavigationMenuArray()
{
+ $listFiltersSent = array();
+ $listFiltersNotSent = array();
+
$filtersSent = $this->FiltersModel->getFilterList('infocenter', 'PersonActions', '%InfoCenterSentApplication%');
if (hasData($filtersSent))
{
From 9f4f4909b99ac4e79da550a16bc860f300e81b81 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20=C3=96sterreicher?=
Date: Thu, 8 Feb 2018 19:37:33 +0100
Subject: [PATCH 02/10] Infocenter Rolle angepasst
---
application/config/fhcomplete.php | 2 --
application/config/roles.php | 2 +-
2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/application/config/fhcomplete.php b/application/config/fhcomplete.php
index 29c93e2e4..31c7dc6f6 100644
--- a/application/config/fhcomplete.php
+++ b/application/config/fhcomplete.php
@@ -240,8 +240,6 @@ $config['fhc_acl'] = array
DMS_PATH => 'fs/dms',
- 'public.tbl_sprache' => 'admin',
-
'PhrasesLib.getPhrase' => 'system/PhrasesLib'
);
diff --git a/application/config/roles.php b/application/config/roles.php
index 6c2d0614b..227321f32 100644
--- a/application/config/roles.php
+++ b/application/config/roles.php
@@ -55,7 +55,7 @@ $config['roles'] = array
(
'basis/adresse','basis/akte','basis/kontakt','basis/log','basis/nation','basis/notiz','basis/notizzuordnung',
'basis/person','basis/prestudent','basis/prestudentstatus','basis/status','basis/zgv','basis/zgvmaster',
- 'lehre/studienplan','system/filters','fs/dms'
+ 'lehre/studienplan','system/filters','fs/dms','basis/message','basis/benutzerrolle', 'basis/sprache'
)
)
);
From d23e44643dca423a2bdd466919b4b3efe4e05157 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20=C3=96sterreicher?=
Date: Thu, 8 Feb 2018 19:37:58 +0100
Subject: [PATCH 03/10] PHP compatibility fix
---
system/environment.php | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/system/environment.php b/system/environment.php
index dc4e6b992..8300c3fa4 100644
--- a/system/environment.php
+++ b/system/environment.php
@@ -92,7 +92,10 @@ printValue("php-curl", extension_loaded('curl'));
$returnArray = array();
exec('unoconv --version',$returnArray);
if(isset($returnArray[0]))
- $unoconvVersion = explode(' ',$returnArray[0])[1];
+{
+ $hlp = explode(' ',$returnArray[0]);
+ $unoconvVersion = $hlp[1];
+}
else
$unoconvVersion = false;
From e2e4f03c598dd493779f2b3212aa6a509c4f68da Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20=C3=96sterreicher?=
Date: Fri, 9 Feb 2018 15:16:53 +0100
Subject: [PATCH 04/10] Removed Model of legacy Table
---
application/config/fhcomplete.php | 2 --
application/models/crm/Aufnahmetermin_model.php | 14 --------------
application/models/crm/Aufnahmetermintyp_model.php | 14 --------------
3 files changed, 30 deletions(-)
delete mode 100644 application/models/crm/Aufnahmetermin_model.php
delete mode 100644 application/models/crm/Aufnahmetermintyp_model.php
diff --git a/application/config/fhcomplete.php b/application/config/fhcomplete.php
index 31c7dc6f6..5bdaa4692 100644
--- a/application/config/fhcomplete.php
+++ b/application/config/fhcomplete.php
@@ -125,8 +125,6 @@ $config['fhc_acl'] = array
'public.tbl_ampel' => 'basis/ampel',
'public.tbl_aufmerksamdurch' => 'basis/aufmerksamdurch',
'public.tbl_aufnahmeschluessel' => 'basis/aufnahmeschluessel',
- 'public.tbl_aufnahmetermin' => 'basis/aufnahmetermin',
- 'public.tbl_aufnahmetermintyp' => 'basis/aufnahmetermintyp',
'public.tbl_bankverbindung' => 'basis/bankverbindung',
'public.tbl_benutzer' => 'basis/benutzer',
'public.tbl_benutzerfunktion' => 'basis/benutzerfunktion',
diff --git a/application/models/crm/Aufnahmetermin_model.php b/application/models/crm/Aufnahmetermin_model.php
deleted file mode 100644
index c023f6403..000000000
--- a/application/models/crm/Aufnahmetermin_model.php
+++ /dev/null
@@ -1,14 +0,0 @@
-dbTable = 'public.tbl_aufnahmetermin';
- $this->pk = 'aufnahmetermin_id';
- }
-}
diff --git a/application/models/crm/Aufnahmetermintyp_model.php b/application/models/crm/Aufnahmetermintyp_model.php
deleted file mode 100644
index e75db011c..000000000
--- a/application/models/crm/Aufnahmetermintyp_model.php
+++ /dev/null
@@ -1,14 +0,0 @@
-dbTable = 'public.tbl_aufnahmetermintyp';
- $this->pk = 'aufnahmetermintyp_kurzbz';
- }
-}
From c57c953eaae5ae12de1b7384371ff24e00718a5c Mon Sep 17 00:00:00 2001
From: Paolo
Date: Fri, 9 Feb 2018 15:18:44 +0100
Subject: [PATCH 05/10] - 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
---
.../system/infocenter/InfoCenter.php | 42 +++++++++++--
application/helpers/fhc_helper.php | 16 ++---
application/models/system/Filters_model.php | 12 +++-
.../system/infocenter/infocenterData.php | 8 +--
application/views/widgets/navigationMenu.php | 63 ++++++++++++-------
application/widgets/FilterWidget.php | 2 +-
application/widgets/NavigationMenuWidget.php | 22 +++++--
7 files changed, 119 insertions(+), 46 deletions(-)
diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php
index 6e08c1b57..85b9641fb 100644
--- a/application/controllers/system/infocenter/InfoCenter.php
+++ b/application/controllers/system/infocenter/InfoCenter.php
@@ -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);
}
/**
diff --git a/application/helpers/fhc_helper.php b/application/helpers/fhc_helper.php
index a7b5b2a29..7fb6d9f91 100644
--- a/application/helpers/fhc_helper.php
+++ b/application/helpers/fhc_helper.php
@@ -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)
}
}
}
-}
\ No newline at end of file
+}
diff --git a/application/models/system/Filters_model.php b/application/models/system/Filters_model.php
index 7ce07de09..d84cddf80 100644
--- a/application/models/system/Filters_model.php
+++ b/application/models/system/Filters_model.php
@@ -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);
}
}
diff --git a/application/views/system/infocenter/infocenterData.php b/application/views/system/infocenter/infocenterData.php
index 53e274866..28b2d018e 100644
--- a/application/views/system/infocenter/infocenterData.php
+++ b/application/views/system/infocenter/infocenterData.php
@@ -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
{
diff --git a/application/views/widgets/navigationMenu.php b/application/views/widgets/navigationMenu.php
index c67f90a55..46905204f 100644
--- a/application/views/widgets/navigationMenu.php
+++ b/application/views/widgets/navigationMenu.php
@@ -1,8 +1,8 @@
">