diff --git a/application/config/fhcomplete.php b/application/config/fhcomplete.php index 29c93e2e4..3b24595a7 100644 --- a/application/config/fhcomplete.php +++ b/application/config/fhcomplete.php @@ -116,7 +116,6 @@ $config['fhc_acl'] = array 'lehre.tbl_vertrag' => 'basis/vertrag', 'lehre.tbl_vertragsstatus' => 'basis/vertragsstatus', 'lehre.tbl_vertragstyp' => 'basis/vertragstyp', - 'lehre.tbl_zeitfenster' => 'basis/zeitfenster', 'lehre.tbl_zeugnis' => 'basis/zeugnis', 'lehre.tbl_zeugnisnote' => 'basis/zeugnisnote', 'lehre.vw_studienplan' => 'lehre/studienplan', @@ -125,8 +124,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', @@ -240,8 +237,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' ) ) ); diff --git a/application/controllers/system/Messages.php b/application/controllers/system/Messages.php index e0642ca02..2c2474a1e 100644 --- a/application/controllers/system/Messages.php +++ b/application/controllers/system/Messages.php @@ -27,8 +27,19 @@ class Messages extends VileSci_Controller /** * write */ - public function write($sender_id, $msg_id = null, $receiver_id = null) + public function write($sender_id = null, $msg_id = null, $receiver_id = null) { + if ($sender_id === null) + { + $user_person = $this->PersonModel->getByUid($this->uid); + + if (isError($user_person)) + { + show_error($user_person->retval); + } + $sender_id = $user_person->retval[0]->person_id; + } + $prestudent_id = $this->input->post('prestudent_id'); $person_id = $this->input->post('person_id'); $personOnly = false; @@ -68,7 +79,7 @@ class Messages extends VileSci_Controller $benutzerResult = $this->BenutzerfunktionModel->getByPersonId($sender_id); if (hasData($benutzerResult)) { - foreach($benutzerResult->retval as $val) + foreach ($benutzerResult->retval as $val) { $oe_kurzbz[] = $val->oe_kurzbz; } @@ -95,6 +106,12 @@ class Messages extends VileSci_Controller $v = $this->load->view('system/messageWrite', $data); } + /** + * gets Message Variables and their data for Prestudent + * @param $prestudent_id + * @param $variablesArray to be filled with variable names + * @param $msgVarsData to be filled with variable data + */ private function getPrestudentMsgData($prestudent_id, &$variablesArray, &$msgVarsData) { $msgVarsData = $this->MessageModel->getMsgVarsDataByPrestudentId($prestudent_id); @@ -111,7 +128,7 @@ class Messages extends VileSci_Controller { $variablesArray = array(); // Skip person_id and prestudent_id - for($i = 2; $i < count($variables->retval); $i++) + for ($i = 2; $i < count($variables->retval); $i++) { $variablesArray['{'.str_replace(" ", "_", strtolower($variables->retval[$i])).'}'] = $variables->retval[$i]; } @@ -121,6 +138,12 @@ class Messages extends VileSci_Controller array_shift($variables->retval); // Remove prestudent_id } + /** + * gets Message Variables and their data for Person + * @param $person_id + * @param $variablesArray to be filled with variable names + * @param $msgVarsData to be filled with variable data + */ private function getPersonMsgData($person_id, &$variablesArray, &$msgVarsData) { $msgVarsData = $this->MessageModel->getMsgVarsDataByPersonId($person_id); @@ -137,7 +160,7 @@ class Messages extends VileSci_Controller { $variablesArray = array(); // Skip person_id - for($i = 1; $i < count($variables->retval); $i++) + for ($i = 1; $i < count($variables->retval); $i++) { $variablesArray['{'.str_replace(" ", "_", strtolower($variables->retval[$i])).'}'] = $variables->retval[$i]; } @@ -148,8 +171,19 @@ class Messages extends VileSci_Controller /** * send */ - public function send($sender_id) + public function send($sender_id = null) { + if ($sender_id === null) + { + $user_person = $this->PersonModel->getByUid($this->uid); + + if (isError($user_person)) + { + show_error($user_person->retval); + } + $sender_id = $user_person->retval[0]->person_id; + } + $error = false; $subject = $this->input->post('subject'); @@ -165,7 +199,7 @@ class Messages extends VileSci_Controller // get message data of prestudents or persons $prestudentsData = array(); - if($prestudents !== null) + if ($prestudents !== null) { $data = $this->MessageModel->getMsgVarsDataByPrestudentId($prestudents); // @@ -182,7 +216,7 @@ class Messages extends VileSci_Controller { $parsedText = ""; $dataArray = (array)$data->retval[$i]; - foreach($dataArray as $key => $val) + foreach ($dataArray as $key => $val) { $newKey = str_replace(" ", "_", strtolower($key)); $dataArray[$newKey] = $dataArray[$key]; @@ -191,7 +225,7 @@ class Messages extends VileSci_Controller $parsedText = $this->messagelib->parseMessageText($body, $dataArray); $oe_kurzbz = null; - if(hasData($prestudentsData)) + if (hasData($prestudentsData)) { for ($p = 0; $p < count($prestudentsData->retval); $p++) { @@ -247,7 +281,7 @@ class Messages extends VileSci_Controller { $person_id = $this->input->get('person_id'); } - else if ($this->input->post('person_id') !== null) + elseif ($this->input->post('person_id') !== null) { $person_id = $this->input->get('person_id'); } @@ -310,7 +344,7 @@ class Messages extends VileSci_Controller if (hasData($data)) { $dataArray = (array)$data->retval[0]; - foreach($dataArray as $key => $val) + foreach ($dataArray as $key => $val) { $newKey = str_replace(" ", "_", strtolower($key)); $dataArray[$newKey] = $dataArray[$key]; diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index 6e08c1b57..f1cd674b7 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 @@ -386,6 +402,9 @@ class InfoCenter extends VileSci_Controller */ private function _setNavigationMenuArray() { + $listFiltersSent = array(); + $listFiltersNotSent = array(); + $filtersSent = $this->FiltersModel->getFilterList('infocenter', 'PersonActions', '%InfoCenterSentApplication%'); if (hasData($filtersSent)) { @@ -446,7 +465,7 @@ class InfoCenter extends VileSci_Controller 'children' => array() ); - $this->_fillFilters($listCustomFilters, $filtersarray['personal']); + $this->_fillCustomFilters($listCustomFilters, $filtersarray['personal']); } $this->navigationMenuArray = array( @@ -471,12 +490,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 +660,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..549247754 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,12 +51,13 @@ 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 for ($i = 0; $i < $length; $i++) $token .= $characters[mt_rand(0, $charactersLength)]; + return $token; } @@ -96,18 +97,18 @@ function loadResource($path, $resources = null, $subdir = false) { $path .= '/'; } - + // Loads in $tmpResources all the given resources $tmpResources = $resources; if ($resources == null) { $tmpResources = array(); } - else if (!is_array($resources)) + elseif (!is_array($resources)) { $tmpResources = array($resources); } - + // Loads in $tmpPaths path and eventually the subdirectories $tmpPaths = array($path); // NOTE: Used @ to prevent ugly error messages @@ -133,12 +134,12 @@ function loadResource($path, $resources = null, $subdir = false) } closedir($dirHandler); } - + // Loops through the resources - foreach($tmpResources as $tmpResource) + foreach ($tmpResources as $tmpResource) { // Loops through the paths - foreach($tmpPaths as $tmpPath) + foreach ($tmpPaths as $tmpPath) { $fileName = $tmpPath.$tmpResource.'.php'; // Php extension if (file_exists($fileName)) @@ -147,4 +148,4 @@ function loadResource($path, $resources = null, $subdir = false) } } } -} \ No newline at end of file +} 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'; - } -} diff --git a/application/models/ressource/Zeitfenster_model.php b/application/models/ressource/Zeitfenster_model.php deleted file mode 100644 index e9ef6709c..000000000 --- a/application/models/ressource/Zeitfenster_model.php +++ /dev/null @@ -1,14 +0,0 @@ -dbTable = 'lehre.tbl_zeitfenster'; - $this->pk = array('wochentag', 'studiengang_kz', 'ort_kurzbz', 'stunde'); - } -} 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/infocenter.php b/application/views/system/infocenter/infocenter.php index 3b598203b..8244e8c67 100644 --- a/application/views/system/infocenter/infocenter.php +++ b/application/views/system/infocenter/infocenter.php @@ -8,7 +8,8 @@ 'fontawesome' => true, 'sbadmintemplate' => true, 'tablesorter' => true, - 'customCSSs' => 'skin/tablesort_bootstrap.css' + 'customCSSs' => 'skin/tablesort_bootstrap.css', + 'customJSs' => array('include/js/infocenterPersonDataset.js', 'include/js/bootstrapper.js') ) ); ?> @@ -40,11 +41,7 @@ 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/system/infocenter/infocenterDetails.php b/application/views/system/infocenter/infocenterDetails.php index ed6bb2c7f..16effcfdd 100644 --- a/application/views/system/infocenter/infocenterDetails.php +++ b/application/views/system/infocenter/infocenterDetails.php @@ -10,7 +10,8 @@ $this->load->view( 'tablesorter' => true, 'tinymce' => true, 'sbadmintemplate' => true, - 'customCSSs' => array('skin/admintemplate.css', 'skin/tablesort_bootstrap.css') + 'customCSSs' => array('skin/admintemplate.css', 'skin/tablesort_bootstrap.css'), + 'customJSs' => 'include/js/bootstrapper.js' ) ); ?> @@ -127,10 +128,6 @@ $this->load->view( $(document).ready( function () { - //javascript bootstrap hack - not nice! - $("select").addClass('form-control'); - $("table").addClass('table-condensed'); - //initialise table sorter addTablesorter("doctable", [[2, 1], [1, 0]], ["zebra"]); addTablesorter("nachgdoctable", [[2, 0], [1, 1]], ["zebra"]); @@ -148,14 +145,6 @@ $this->load->view( "dateFormat": "dd.mm.yy" }); - //add submit event to message send link - $("#sendmsglink").click( - function() - { - $("#sendmsgform").submit(); - } - ); - //add click events to "formal geprüft" checkboxes diff --git a/application/views/system/infocenter/stammdaten.php b/application/views/system/infocenter/stammdaten.php index bd58879be..3e2ec1fb7 100644 --- a/application/views/system/infocenter/stammdaten.php +++ b/application/views/system/infocenter/stammdaten.php @@ -98,12 +98,18 @@ zugangscode)): ?>
-  Zugang - Bewerbung +  Zugang Bewerbung
- \ No newline at end of file + + \ No newline at end of file diff --git a/application/views/system/messageList.php b/application/views/system/messageList.php index c14da6217..e0369ae56 100644 --- a/application/views/system/messageList.php +++ b/application/views/system/messageList.php @@ -1,4 +1,8 @@ -
+ 0; +$widthColumn = $msgExists === true ? 8 : 12; +?> +
@@ -22,6 +26,7 @@
+

@@ -29,6 +34,7 @@
+
@@ -58,23 +63,25 @@
-
-
-
-

+
+
+
+ +
+
diff --git a/application/views/widgets/filter/selectFields.php b/application/views/widgets/filter/selectFields.php index 729cfedc4..c94168d6f 100644 --- a/application/views/widgets/filter/selectFields.php +++ b/application/views/widgets/filter/selectFields.php @@ -1,50 +1,63 @@ -
- +
+
+

+ Select columns +

+
+
+
+
+ - - - -
-
- - Add field: - - - + + +
+
+ + Add field: + + + - -
+ if ($columnsAliases != null) + { + $listFieldAlias = $columnsAliases[$listFieldsCounter]; + } + ?> + + + + +
+
+
+
+ diff --git a/application/views/widgets/filter/selectFilters.php b/application/views/widgets/filter/selectFilters.php index bb6de317f..82986d064 100644 --- a/application/views/widgets/filter/selectFilters.php +++ b/application/views/widgets/filter/selectFilters.php @@ -1,65 +1,82 @@ -
-name; - - if ($columnsAliases != null) - { - $indx = array_search($selectedFilter, $listFields); - if ($indx !== false) - { - $selectedFieldAlias = $columnsAliases[$indx]; - } - } - -?> -
- - - - - - - - - - - +
+
+ - - -
-
- - Add filter: - - - - + for ($filtersCounter = 0; $filtersCounter < count($selectedFilters); $filtersCounter++) + { + $selectedFilter = $selectedFilters[$filtersCounter]; + + $md = FilterWidget::getFilterMetaData($selectedFilter, $metaData); + $selectedFieldAlias = $md->name; + + if ($columnsAliases != null) + { + $indx = array_search($selectedFilter, $listFields); + if ($indx !== false) + { + $selectedFieldAlias = $columnsAliases[$indx]; + } + } + + ?> +
+ + + + + + + + + + + +
+ + +
+
+ + Add filter: + + + + + + + + +
+
+
+
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 @@