mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-22 09:22:22 +00:00
Merge branch 'master' into permissions
- Added new core controller called Auth_Controller that extends FHC_Controller and manage the authentication - All the controllers that were extending the CI_Controller now they extend the FHC_Controller - All the controllers that were extending the FHC_Controller now they extend the Auth_Controller - Added the method isAllowed to the FiltersLib to check if the authenticated user has the required permissions - FilterWidget and controller Filters are using the method isAllowed from the FiltersLib
This commit is contained in:
@@ -8,7 +8,7 @@ if (! defined('BASEPATH'))
|
||||
*
|
||||
*/
|
||||
|
||||
class DBTools extends FHC_Controller
|
||||
class DBTools extends Auth_Controller
|
||||
{
|
||||
private $cli = false;
|
||||
/**
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
if (!defined("BASEPATH")) exit("No direct script access allowed");
|
||||
|
||||
class MailJob extends FHC_Controller
|
||||
class MailJob extends Auth_Controller
|
||||
{
|
||||
/**
|
||||
* API constructor
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Redirect extends CI_Controller
|
||||
class Redirect extends FHC_Controller
|
||||
{
|
||||
/**
|
||||
* API constructor
|
||||
|
||||
@@ -19,7 +19,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
* NOTE: in this controller is not possible to include/call everything
|
||||
* that automatically call the authentication system, like the most of models or libraries
|
||||
*/
|
||||
class ViewMessage extends CI_Controller
|
||||
class ViewMessage extends FHC_Controller
|
||||
{
|
||||
/**
|
||||
* API constructor
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Vilesci extends FHC_Controller
|
||||
class Vilesci extends Auth_Controller
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
if (! defined("BASEPATH")) exit("No direct script access allowed");
|
||||
|
||||
class Statusgrund extends FHC_Controller
|
||||
class Statusgrund extends Auth_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@ if (! defined('BASEPATH'))
|
||||
*
|
||||
*/
|
||||
|
||||
class Prestudentstatus extends FHC_Controller
|
||||
class Prestudentstatus extends Auth_Controller
|
||||
{
|
||||
/**
|
||||
* Initialize Prestudentstatus Class
|
||||
|
||||
@@ -5,7 +5,7 @@ if (!defined("BASEPATH")) exit("No direct script access allowed");
|
||||
/**
|
||||
* Studienjahr controller for listing, editing and removing a Studienjahr
|
||||
*/
|
||||
class Studienjahr extends FHC_Controller
|
||||
class Studienjahr extends Auth_Controller
|
||||
{
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,7 +5,7 @@ if (!defined("BASEPATH")) exit("No direct script access allowed");
|
||||
/**
|
||||
* Studiensemester controller for listing, editing and removing a Studiensemester
|
||||
*/
|
||||
class Studiensemester extends FHC_Controller
|
||||
class Studiensemester extends Auth_Controller
|
||||
{
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,572 +3,253 @@
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
*
|
||||
* This controller operates between (interface) the JS (GUI) and the FiltersLib (back-end)
|
||||
* Provides data to the ajax get calls about the filter
|
||||
* Accepts ajax post calls to change the filter data
|
||||
* This controller works with JSON calls on the HTTP GET or POST and the output is always JSON
|
||||
*/
|
||||
class Filters extends CI_Controller
|
||||
class Filters extends FHC_Controller
|
||||
{
|
||||
const SESSION_NAME = 'FHC_FILTER_WIDGET';
|
||||
|
||||
const SELECTED_FIELDS = 'selectedFields';
|
||||
const SELECTED_FILTERS = 'selectedFilters';
|
||||
const ACTIVE_FILTERS = 'activeFilters';
|
||||
const ACTIVE_FILTERS_OPTION = 'activeFiltersOption';
|
||||
const ACTIVE_FILTERS_OPERATION = 'activeFiltersOperation';
|
||||
const FILTER_NAME = 'filterName';
|
||||
const FILTER_PAGE_PARAM = 'filter_page';
|
||||
|
||||
/**
|
||||
*
|
||||
* Calls the parent's constructor and loads the FiltersLib
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
// Load session library
|
||||
$this->load->library('session');
|
||||
// Load permission library
|
||||
$this->load->library('PermissionLib');
|
||||
|
||||
$this->load->model('system/Filters_model', 'FiltersModel');
|
||||
$this->load->model('person/Benutzer_model', 'BenutzerModel');
|
||||
// Loads the FiltersLib with HTTP GET/POST parameters
|
||||
$this->_loadFiltersLib();
|
||||
|
||||
// Checks if the caller is allow to read this data
|
||||
$this->_isAllowed();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
*
|
||||
* Retrives data about the current filter from the session and will be written on the output in JSON format
|
||||
*/
|
||||
public function tableDataset()
|
||||
public function getFilter()
|
||||
{
|
||||
$json = new stdClass();
|
||||
|
||||
$session = $this->_readSession($this->input->get('fhc_controller_id'));
|
||||
|
||||
$json->selectedFields = $session['selectedFields'];
|
||||
$json->columnsAliases = $session['columnsAliases'];
|
||||
$json->additionalColumns = $session['additionalColumns'];
|
||||
$json->checkboxes = $session['checkboxes'];
|
||||
$json->dataset = $session['dataset'];
|
||||
|
||||
$this->output->set_content_type('application/json')->set_output(json_encode($json));
|
||||
$this->outputJsonSuccess($this->filterslib->getSession());
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function selectFields()
|
||||
{
|
||||
$json = new stdClass();
|
||||
|
||||
$session = $this->_readSession($this->input->get('fhc_controller_id'));
|
||||
|
||||
$json->allSelectedFields = $session['allSelectedFields'];
|
||||
$json->allColumnsAliases = $session['allColumnsAliases'];
|
||||
|
||||
$json->selectedFields = $session['selectedFields'];
|
||||
$json->columnsAliases = $session['columnsAliases'];
|
||||
|
||||
$this->output->set_content_type('application/json')->set_output(json_encode($json));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function sortSelectedFields()
|
||||
{
|
||||
$selectedFieldsLst = $this->input->post('selectedFieldsLst');
|
||||
$fhc_controller_id = $this->input->post('fhc_controller_id');
|
||||
|
||||
$json = new stdClass();
|
||||
|
||||
$session = $this->_readSession($fhc_controller_id);
|
||||
|
||||
$allSelectedFields = $session['allSelectedFields'];
|
||||
$allColumnsAliases = $session['allColumnsAliases'];
|
||||
|
||||
$json->selectedFields = $session['selectedFields'];
|
||||
$json->columnsAliases = $session['columnsAliases'];
|
||||
|
||||
if (isset($selectedFieldsLst) && is_array($selectedFieldsLst))
|
||||
{
|
||||
$json->selectedFields = $selectedFieldsLst;
|
||||
$json->columnsAliases = array();
|
||||
|
||||
for ($i = 0; $i < count($json->selectedFields); $i++)
|
||||
{
|
||||
$pos = array_search($json->selectedFields[$i], $allSelectedFields);
|
||||
|
||||
$json->columnsAliases[$i] = $json->selectedFields[$i];
|
||||
|
||||
if ($pos !== false)
|
||||
{
|
||||
if ($allColumnsAliases != null && is_array($allColumnsAliases))
|
||||
{
|
||||
$json->columnsAliases[$i] = $allColumnsAliases[$pos];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$_SESSION[self::SESSION_NAME][$fhc_controller_id]['selectedFields'] = $json->selectedFields;
|
||||
$_SESSION[self::SESSION_NAME][$fhc_controller_id]['columnsAliases'] = $json->columnsAliases;
|
||||
|
||||
$this->output->set_content_type('application/json')->set_output(json_encode($json));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function selectFilters()
|
||||
{
|
||||
$json = new stdClass();
|
||||
|
||||
$session = $this->_readSession($this->input->get('fhc_controller_id'));
|
||||
|
||||
$json->allSelectedFields = $session['allSelectedFields'];
|
||||
$json->allColumnsAliases = $session['allColumnsAliases'];
|
||||
|
||||
$json->selectedFilters = $session['selectedFilters'];
|
||||
$json->selectedFiltersAliases = array();
|
||||
$json->selectedFiltersMetaData = array();
|
||||
|
||||
$json->selectedFiltersActiveFilters = array();
|
||||
$json->selectedFiltersActiveFiltersOperation = array();
|
||||
$json->selectedFiltersActiveFiltersOption = array();
|
||||
|
||||
$metaData = $session['metaData'];
|
||||
$activeFilters = $session['activeFilters'];
|
||||
$activeFiltersOperation = $session['activeFiltersOperation'];
|
||||
$activeFiltersOption = $session['activeFiltersOption'];
|
||||
|
||||
for ($i = 0; $i < count($json->selectedFilters); $i++)
|
||||
{
|
||||
$pos = array_search($json->selectedFilters[$i], $json->allSelectedFields);
|
||||
|
||||
if ($pos !== false)
|
||||
{
|
||||
$json->selectedFiltersAliases[$i] = $json->selectedFilters[$i];
|
||||
if ($json->allColumnsAliases != null && is_array($json->allColumnsAliases))
|
||||
{
|
||||
$json->selectedFiltersAliases[$i] = $json->allColumnsAliases[$pos];
|
||||
}
|
||||
|
||||
$json->selectedFiltersMetaData[] = $metaData[$pos];
|
||||
|
||||
if (isset($activeFilters[$json->selectedFilters[$i]]))
|
||||
{
|
||||
$json->selectedFiltersActiveFilters[] = $activeFilters[$json->selectedFilters[$i]];
|
||||
}
|
||||
|
||||
if (isset($activeFiltersOperation[$json->selectedFilters[$i]]))
|
||||
{
|
||||
$json->selectedFiltersActiveFiltersOperation[] = $activeFiltersOperation[$json->selectedFilters[$i]];
|
||||
}
|
||||
|
||||
if (isset($activeFiltersOption[$json->selectedFilters[$i]]))
|
||||
{
|
||||
$json->selectedFiltersActiveFiltersOption[] = $activeFiltersOption[$json->selectedFilters[$i]];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->output->set_content_type('application/json')->set_output(json_encode($json));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function saveFilter()
|
||||
{
|
||||
$this->_saveFilter($this->input->post("customFilterDescription"), $this->input->post("fhc_controller_id"));
|
||||
|
||||
$this->output->set_content_type('application/json')->set_output(json_encode('Tutto bene!!!'));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private function _saveFilter($customFilterDescription, $fhc_controller_id)
|
||||
{
|
||||
$objToBeSaved = new stdClass();
|
||||
|
||||
$filterSessionArray = $this->_readSession($fhc_controller_id);
|
||||
|
||||
$objToBeSaved->name = $customFilterDescription;
|
||||
|
||||
if (isset($filterSessionArray[self::SELECTED_FIELDS]))
|
||||
{
|
||||
$selectedFields = $filterSessionArray[self::SELECTED_FIELDS];
|
||||
$objToBeSaved->columns = array();
|
||||
|
||||
for ($selectedFieldsCounter = 0; $selectedFieldsCounter < count($selectedFields); $selectedFieldsCounter++)
|
||||
{
|
||||
$objToBeSaved->columns[$selectedFieldsCounter] = new stdClass();
|
||||
$objToBeSaved->columns[$selectedFieldsCounter]->name = $selectedFields[$selectedFieldsCounter];
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($filterSessionArray[self::SELECTED_FILTERS]))
|
||||
{
|
||||
$selectedFilters = $filterSessionArray[self::SELECTED_FILTERS];
|
||||
$objToBeSaved->filters = array();
|
||||
|
||||
for ($selectedFiltersCounter = 0; $selectedFiltersCounter < count($selectedFilters); $selectedFiltersCounter++)
|
||||
{
|
||||
$objToBeSaved->filters[$selectedFiltersCounter] = new stdClass();
|
||||
$objToBeSaved->filters[$selectedFiltersCounter]->name = $selectedFilters[$selectedFiltersCounter];
|
||||
|
||||
if (isset($filterSessionArray[self::ACTIVE_FILTERS])
|
||||
&& isset($filterSessionArray[self::ACTIVE_FILTERS][$selectedFilters[$selectedFiltersCounter]]))
|
||||
{
|
||||
$objToBeSaved->filters[$selectedFiltersCounter]->condition = $filterSessionArray[self::ACTIVE_FILTERS][$selectedFilters[$selectedFiltersCounter]];
|
||||
}
|
||||
|
||||
if (isset($filterSessionArray[self::ACTIVE_FILTERS_OPERATION])
|
||||
&& isset($filterSessionArray[self::ACTIVE_FILTERS_OPERATION][$selectedFilters[$selectedFiltersCounter]]))
|
||||
{
|
||||
$objToBeSaved->filters[$selectedFiltersCounter]->operation = $filterSessionArray[self::ACTIVE_FILTERS_OPERATION][$selectedFilters[$selectedFiltersCounter]];
|
||||
}
|
||||
|
||||
if (isset($filterSessionArray[self::ACTIVE_FILTERS_OPTION])
|
||||
&& isset($filterSessionArray[self::ACTIVE_FILTERS_OPTION][$selectedFilters[$selectedFiltersCounter]]))
|
||||
{
|
||||
$objToBeSaved->filters[$selectedFiltersCounter]->option = $filterSessionArray[self::ACTIVE_FILTERS_OPTION][$selectedFilters[$selectedFiltersCounter]];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$desc = $customFilterDescription;
|
||||
$descPGArray = '{"'.$desc.'", "'.$desc.'", "'.$desc.'", "'.$desc.'"}';
|
||||
|
||||
$resultBenutzer = $this->BenutzerModel->load(getAuthUID());
|
||||
$personId = $resultBenutzer->retval[0]->person_id;
|
||||
|
||||
$result = $this->FiltersModel->loadWhere(array(
|
||||
'app' => $_SESSION[self::SESSION_NAME][$fhc_controller_id]['app'],
|
||||
'dataset_name' => $_SESSION[self::SESSION_NAME][$fhc_controller_id]['datasetName'],
|
||||
'description' => $descPGArray,
|
||||
'person_id' => $personId
|
||||
));
|
||||
|
||||
if (hasData($result))
|
||||
{
|
||||
$this->FiltersModel->update(
|
||||
array(
|
||||
'app' => $_SESSION[self::SESSION_NAME][$fhc_controller_id]['app'],
|
||||
'dataset_name' => $_SESSION[self::SESSION_NAME][$fhc_controller_id]['datasetName'],
|
||||
'description' => $descPGArray,
|
||||
'person_id' => $personId
|
||||
),
|
||||
array(
|
||||
'filter' => json_encode($objToBeSaved)
|
||||
)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->FiltersModel->insert(array(
|
||||
'app' => $_SESSION[self::SESSION_NAME][$fhc_controller_id]['app'],
|
||||
'dataset_name' => $_SESSION[self::SESSION_NAME][$fhc_controller_id]['datasetName'],
|
||||
'filter_kurzbz' => uniqid($personId, true),
|
||||
'person_id' => $personId,
|
||||
'description' => $descPGArray,
|
||||
'sort' => null,
|
||||
'default_filter' => false,
|
||||
'filter' => json_encode($objToBeSaved),
|
||||
'oe_kurzbz' => null
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function deleteCustomFilter()
|
||||
{
|
||||
$filter_id = $this->input->post('filter_id');
|
||||
$fhc_controller_id = $this->input->post('fhc_controller_id');
|
||||
|
||||
if (is_numeric($filter_id))
|
||||
{
|
||||
$this->FiltersModel->deleteCustomFilter($filter_id);
|
||||
|
||||
$this->output->set_content_type('application/json')->set_output(json_encode('Removed'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function removeSelectedFields()
|
||||
{
|
||||
$fieldName = $this->input->post('fieldName');
|
||||
$fhc_controller_id = $this->input->post('fhc_controller_id');
|
||||
|
||||
$session = $this->_readSession($fhc_controller_id);
|
||||
|
||||
$allSelectedFields = $session['allSelectedFields'];
|
||||
$allColumnsAliases = $session['allColumnsAliases'];
|
||||
|
||||
$selectedFields = $session['selectedFields'];
|
||||
$columnsAliases = $session['columnsAliases'];
|
||||
|
||||
if (($pos = array_search($fieldName, $selectedFields)) !== false)
|
||||
{
|
||||
array_splice($selectedFields, $pos, 1);
|
||||
|
||||
if ($columnsAliases != null && is_array($columnsAliases))
|
||||
{
|
||||
array_splice($columnsAliases, $pos, 1);
|
||||
}
|
||||
}
|
||||
|
||||
$_SESSION[self::SESSION_NAME][$fhc_controller_id]['selectedFields'] = $selectedFields;
|
||||
$_SESSION[self::SESSION_NAME][$fhc_controller_id]['columnsAliases'] = $columnsAliases;
|
||||
|
||||
$json = new stdClass();
|
||||
|
||||
$json->allSelectedFields = $allSelectedFields;
|
||||
$json->allColumnsAliases = $allColumnsAliases;
|
||||
$json->selectedFields = $selectedFields;
|
||||
$json->columnsAliases = $columnsAliases;
|
||||
|
||||
$this->output->set_content_type('application/json')->set_output(json_encode($json));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function removeSelectedFilters()
|
||||
{
|
||||
$fieldName = $this->input->post('fieldName');
|
||||
$fhc_controller_id = $this->input->post('fhc_controller_id');
|
||||
|
||||
$session = $this->_readSession($fhc_controller_id);
|
||||
|
||||
$selectedFilters = $session['selectedFilters'];
|
||||
$selectedFiltersActiveFilters = $session['activeFilters'];
|
||||
$selectedFiltersActiveFiltersOperation = $session['activeFiltersOperation'];
|
||||
$selectedFiltersActiveFiltersOption = $session['activeFiltersOption'];
|
||||
|
||||
if (($pos = array_search($fieldName, $selectedFilters)) !== false)
|
||||
{
|
||||
array_splice($selectedFilters, $pos, 1);
|
||||
array_splice($selectedFiltersActiveFilters, $pos, 1);
|
||||
array_splice($selectedFiltersActiveFiltersOperation, $pos, 1);
|
||||
array_splice($selectedFiltersActiveFiltersOption, $pos, 1);
|
||||
}
|
||||
|
||||
$_SESSION[self::SESSION_NAME][$fhc_controller_id]['selectedFilters'] = $selectedFilters;
|
||||
$_SESSION[self::SESSION_NAME][$fhc_controller_id]['activeFilters'] = $selectedFiltersActiveFilters;
|
||||
$_SESSION[self::SESSION_NAME][$fhc_controller_id]['activeFiltersOperation'] = $selectedFiltersActiveFiltersOperation;
|
||||
$_SESSION[self::SESSION_NAME][$fhc_controller_id]['activeFiltersOption'] = $selectedFiltersActiveFiltersOption;
|
||||
|
||||
$json = new stdClass();
|
||||
|
||||
$json->selectedFilters = $selectedFilters;
|
||||
$json->selectedFiltersActiveFilters = $selectedFiltersActiveFilters;
|
||||
$json->selectedFiltersActiveFiltersOperation = $selectedFiltersActiveFiltersOperation;
|
||||
$json->selectedFiltersActiveFiltersOption = $selectedFiltersActiveFiltersOption;
|
||||
|
||||
$this->output->set_content_type('application/json')->set_output(json_encode($json));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function addSelectedFields()
|
||||
{
|
||||
$fieldName = $this->input->post('fieldName');
|
||||
$fhc_controller_id = $this->input->post('fhc_controller_id');
|
||||
|
||||
$session = $this->_readSession($fhc_controller_id);
|
||||
|
||||
$allSelectedFields = $session['allSelectedFields'];
|
||||
$allColumnsAliases = $session['allColumnsAliases'];
|
||||
|
||||
$selectedFields = $session['selectedFields'];
|
||||
$columnsAliases = $session['columnsAliases'];
|
||||
|
||||
if (($pos = array_search($fieldName, $allSelectedFields)) !== false
|
||||
&& array_search($fieldName, $selectedFields) === false)
|
||||
{
|
||||
array_push($selectedFields, $fieldName);
|
||||
|
||||
if ($columnsAliases != null && is_array($columnsAliases))
|
||||
{
|
||||
array_push($columnsAliases, $allColumnsAliases[$pos]);
|
||||
}
|
||||
}
|
||||
|
||||
$_SESSION[self::SESSION_NAME][$fhc_controller_id]['selectedFields'] = $selectedFields;
|
||||
$_SESSION[self::SESSION_NAME][$fhc_controller_id]['columnsAliases'] = $columnsAliases;
|
||||
|
||||
$json = new stdClass();
|
||||
|
||||
$json->allSelectedFields = $allSelectedFields;
|
||||
$json->allColumnsAliases = $allColumnsAliases;
|
||||
$json->selectedFields = $selectedFields;
|
||||
$json->columnsAliases = $columnsAliases;
|
||||
|
||||
$this->output->set_content_type('application/json')->set_output(json_encode($json));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function addSelectedFilters()
|
||||
{
|
||||
$fieldName = $this->input->post('fieldName');
|
||||
$fhc_controller_id = $this->input->post('fhc_controller_id');
|
||||
|
||||
$session = $this->_readSession($fhc_controller_id);
|
||||
|
||||
$selectedFilters = $session['selectedFilters'];
|
||||
$selectedFiltersActiveFilters = $session['activeFilters'];
|
||||
$selectedFiltersActiveFiltersOperation = $session['activeFiltersOperation'];
|
||||
$selectedFiltersActiveFiltersOption = $session['activeFiltersOption'];
|
||||
|
||||
if (!in_array($fieldName, $selectedFilters))
|
||||
{
|
||||
array_push($selectedFilters, $fieldName);
|
||||
$selectedFiltersActiveFilters[$fieldName] = "";
|
||||
$selectedFiltersActiveFiltersOperation[$fieldName] = "";
|
||||
$selectedFiltersActiveFiltersOption[$fieldName] = "";
|
||||
}
|
||||
|
||||
$_SESSION[self::SESSION_NAME][$fhc_controller_id]['selectedFilters'] = $selectedFilters;
|
||||
$_SESSION[self::SESSION_NAME][$fhc_controller_id]['activeFilters'] = $selectedFiltersActiveFilters;
|
||||
$_SESSION[self::SESSION_NAME][$fhc_controller_id]['activeFiltersOperation'] = $selectedFiltersActiveFiltersOperation;
|
||||
$_SESSION[self::SESSION_NAME][$fhc_controller_id]['activeFiltersOption'] = $selectedFiltersActiveFiltersOption;
|
||||
|
||||
$json = new stdClass();
|
||||
|
||||
$json->selectedFilters = $selectedFilters;
|
||||
$json->selectedFiltersActiveFilters = $selectedFiltersActiveFilters;
|
||||
$json->selectedFiltersActiveFiltersOperation = $selectedFiltersActiveFiltersOperation;
|
||||
$json->selectedFiltersActiveFiltersOption = $selectedFiltersActiveFiltersOption;
|
||||
|
||||
$this->output->set_content_type('application/json')->set_output(json_encode($json));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function applyFilter()
|
||||
{
|
||||
$fieldNames = $this->input->post('filterNames');
|
||||
$filterOperations = $this->input->post('filterOperations');
|
||||
$filterOperationValues = $this->input->post('filterOperationValues');
|
||||
$filterOptions = $this->input->post('filterOptions');
|
||||
$fhc_controller_id = $this->input->post('fhc_controller_id');
|
||||
|
||||
$session = $this->_readSession($fhc_controller_id);
|
||||
|
||||
if ($fieldNames == null) $fieldNames = array();
|
||||
if ($filterOperationValues == null) $filterOperationValues = array();
|
||||
if ($filterOperations == null) $filterOperations = array();
|
||||
if ($filterOptions == null) $filterOptions = array();
|
||||
|
||||
$activeFilters = array_combine($fieldNames, $filterOperationValues);
|
||||
$activeFiltersOperation = array_combine($fieldNames, $filterOperations);
|
||||
$activeFiltersOption = array_combine($fieldNames, $filterOptions);
|
||||
|
||||
$_SESSION[self::SESSION_NAME][$fhc_controller_id]['activeFilters'] = $activeFilters;
|
||||
$_SESSION[self::SESSION_NAME][$fhc_controller_id]['activeFiltersOperation'] = $activeFiltersOperation;
|
||||
$_SESSION[self::SESSION_NAME][$fhc_controller_id]['activeFiltersOption'] = $activeFiltersOption;
|
||||
|
||||
$json = new stdClass();
|
||||
|
||||
$json->fieldNames = $fieldNames;
|
||||
$json->activeFilters = $activeFilters;
|
||||
$json->activeFiltersOperation = $activeFiltersOperation;
|
||||
$json->activeFiltersOption = $activeFiltersOption;
|
||||
|
||||
$this->output->set_content_type('application/json')->set_output(json_encode($json));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Retrives the number of records present in the current dataset and will be written on the output in JSON format
|
||||
*/
|
||||
public function rowNumber()
|
||||
{
|
||||
$json = new stdClass();
|
||||
$rowNumber = 0;
|
||||
$dataset = $this->filterslib->getElementSession(FiltersLib::SESSION_DATASET);
|
||||
|
||||
$session = $this->_readSession($this->input->get('fhc_controller_id'));
|
||||
|
||||
$dataset = $session['dataset'];
|
||||
|
||||
if (is_array($dataset))
|
||||
if (isset($dataset) && is_array($dataset))
|
||||
{
|
||||
$json->rowNumber = count($dataset);
|
||||
$rowNumber = count($dataset);
|
||||
}
|
||||
|
||||
$this->output->set_content_type('application/json')->set_output(json_encode($json));
|
||||
$this->outputJsonSuccess($rowNumber);
|
||||
}
|
||||
|
||||
/**
|
||||
* Change the sort of the selected fields of the current filter and
|
||||
* its data will be written on the output in JSON format
|
||||
*/
|
||||
public function sortSelectedFields()
|
||||
{
|
||||
$selectedFields = $this->input->post('selectedFields');
|
||||
|
||||
if ($this->filterslib->sortSelectedFields($selectedFields) == true)
|
||||
{
|
||||
$this->getFilter();
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->outputJsonError('Wrong parameter');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a selected field from the current filter and
|
||||
* its data will be written on the output in JSON format
|
||||
*/
|
||||
public function removeSelectedField()
|
||||
{
|
||||
$selectedField = $this->input->post('selectedField');
|
||||
|
||||
if ($this->filterslib->removeSelectedField($selectedField) == true)
|
||||
{
|
||||
$this->getFilter();
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->outputJsonError('Wrong parameter');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a field to the current filter and its data will be written on the output in JSON format
|
||||
*/
|
||||
public function addSelectedField()
|
||||
{
|
||||
$selectedField = $this->input->post('selectedField');
|
||||
|
||||
if ($this->filterslib->addSelectedField($selectedField) == true)
|
||||
{
|
||||
$this->getFilter();
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->outputJsonError('Wrong parameter');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove an applied filter (SQL where condition) from the current filter
|
||||
*/
|
||||
public function removeAppliedFilter()
|
||||
{
|
||||
$appliedFilter = $this->input->post('appliedFilter');
|
||||
|
||||
if ($this->filterslib->removeAppliedFilter($appliedFilter) == true)
|
||||
{
|
||||
$this->outputJsonSuccess('Removed');
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->outputJsonError('Wrong parameter');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Apply all the applied filters (SQL where conditions) to the current filter
|
||||
*/
|
||||
public function applyFilters()
|
||||
{
|
||||
$appliedFilters = $this->input->post('appliedFilters');
|
||||
$appliedFiltersOperations = $this->input->post('appliedFiltersOperations');
|
||||
$appliedFiltersConditions = $this->input->post('appliedFiltersConditions');
|
||||
$appliedFiltersOptions = $this->input->post('appliedFiltersOptions');
|
||||
|
||||
if ($this->filterslib->applyFilters(
|
||||
$appliedFilters,
|
||||
$appliedFiltersOperations,
|
||||
$appliedFiltersConditions,
|
||||
$appliedFiltersOptions
|
||||
) == true)
|
||||
{
|
||||
$this->outputJsonSuccess('Applied');
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->outputJsonError('Wrong parameter');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a filter (SQL where clause) to be applied to the current filter
|
||||
*/
|
||||
public function addFilter()
|
||||
{
|
||||
$filter = $this->input->post('filter');
|
||||
|
||||
if ($this->filterslib->addFilter($filter) == true)
|
||||
{
|
||||
$this->getFilter();
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->outputJsonError('Wrong parameter');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Save the current filter as a custom filter for this user with the given description
|
||||
*/
|
||||
public function saveCustomFilter()
|
||||
{
|
||||
$customFilterDescription = $this->input->post('customFilterDescription');
|
||||
|
||||
if ($this->filterslib->saveCustomFilter($customFilterDescription) == true)
|
||||
{
|
||||
$this->outputJsonSuccess('Saved');
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->outputJsonError('Wrong parameter');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a custom filter by its filter_id
|
||||
*/
|
||||
public function removeCustomFilter()
|
||||
{
|
||||
$filter_id = $this->input->post('filter_id');
|
||||
|
||||
if ($this->filterslib->removeCustomFilter($filter_id) == true)
|
||||
{
|
||||
$this->outputJsonSuccess('Removed');
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->outputJsonError('Wrong parameter');
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
/**
|
||||
* Checks if the user is allowed to use this filter
|
||||
*/
|
||||
private function _isAllowed()
|
||||
{
|
||||
$isAllowed = false;
|
||||
|
||||
$session = $this->_readSession($this->input->get('fhc_controller_id'));
|
||||
|
||||
if (isset($session['requiredPermissions']))
|
||||
if (!$this->filterslib->isAllowed())
|
||||
{
|
||||
$tmpRequiredPermissions = $session['requiredPermissions'];
|
||||
if (!is_array($tmpRequiredPermissions))
|
||||
{
|
||||
$tmpRequiredPermissions = array($session['requiredPermissions']);
|
||||
}
|
||||
|
||||
for ($i = 0; $i < count($tmpRequiredPermissions); $i++)
|
||||
{
|
||||
$requiredPermissions = array(
|
||||
'filters' => $tmpRequiredPermissions[$i].':rw'
|
||||
);
|
||||
|
||||
if ($this->permissionlib->isEntitled($requiredPermissions, 'filters'))
|
||||
{
|
||||
$isAllowed = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!$isAllowed)
|
||||
{
|
||||
header('Content-Type: application/json');
|
||||
|
||||
echo json_encode('You are not allowed to access to this content');
|
||||
|
||||
exit(1);
|
||||
$this->_terminateWithJsonError('You are not allowed to access to this content');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Loads the FiltersLib with the FILTER_PAGE_PARAM parameter
|
||||
* If the parameter FILTER_PAGE_PARAM is not given then the execution of the controller is terminated and
|
||||
* an error message is printed
|
||||
*/
|
||||
private function _readSession($fhc_controller_id)
|
||||
private function _loadFiltersLib()
|
||||
{
|
||||
if (isset($_SESSION[self::SESSION_NAME]) && isset($_SESSION[self::SESSION_NAME][$fhc_controller_id]))
|
||||
return $_SESSION[self::SESSION_NAME][$fhc_controller_id];
|
||||
// If the parameter FILTER_PAGE_PARAM is present in the HTTP GET or POST
|
||||
if (isset($_GET[self::FILTER_PAGE_PARAM]) || isset($_POST[self::FILTER_PAGE_PARAM]))
|
||||
{
|
||||
// If it is present in the HTTP GET
|
||||
if (isset($_GET[self::FILTER_PAGE_PARAM]))
|
||||
{
|
||||
$filterPage = $this->input->get(self::FILTER_PAGE_PARAM); // is retrived from the HTTP GET
|
||||
}
|
||||
elseif (isset($_POST[self::FILTER_PAGE_PARAM])) // Else if it is present in the HTTP POST
|
||||
{
|
||||
$filterPage = $this->input->post(self::FILTER_PAGE_PARAM); // is retrived from the HTTP POST
|
||||
}
|
||||
|
||||
return array();
|
||||
// Loads the FiltersLib that contains all the used logic
|
||||
$this->load->library('FiltersLib', array(self::FILTER_PAGE_PARAM => $filterPage));
|
||||
}
|
||||
else // Otherwise an error will be written in the output
|
||||
{
|
||||
$this->_terminateWithJsonError('Parameter "'.self::FILTER_PAGE_PARAM.'" not provided!');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Terminate the execution of the page after have printed a message encoded to JSON.
|
||||
* Used directly header and echo to speed up the output before the exit command stops the execution.
|
||||
*/
|
||||
private function _writeSession($data, $fhc_controller_id)
|
||||
private function _terminateWithJsonError($message)
|
||||
{
|
||||
if (!isset($_SESSION[self::SESSION_NAME])
|
||||
|| (isset($_SESSION[self::SESSION_NAME]) && !is_array($_SESSION[self::SESSION_NAME])))
|
||||
{
|
||||
$_SESSION[self::SESSION_NAME] = array();
|
||||
}
|
||||
|
||||
$_SESSION[self::SESSION_NAME][$fhc_controller_id] = $data;
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode(error($message));
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Messages extends FHC_Controller
|
||||
class Messages extends Auth_Controller
|
||||
{
|
||||
private $uid; // contains the UID of the logged user
|
||||
|
||||
@@ -29,6 +29,13 @@ class Messages extends FHC_Controller
|
||||
|
||||
$this->load->model('person/Person_model', 'PersonModel');
|
||||
|
||||
$this->loadPhrases(array(
|
||||
'global',
|
||||
'person',
|
||||
'lehre',
|
||||
'ui',
|
||||
'infocenter'));
|
||||
|
||||
$this->_setAuthUID(); // sets property uid
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class Navigation extends FHC_Controller
|
||||
class Navigation extends Auth_Controller
|
||||
{
|
||||
const SESSION_NAME = 'NAVIGATION_MENU';
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Phrases extends FHC_Controller
|
||||
class Phrases extends Auth_Controller
|
||||
{
|
||||
/**
|
||||
*
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class UDF extends FHC_Controller
|
||||
class UDF extends Auth_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Vorlage extends FHC_Controller
|
||||
class Vorlage extends Auth_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class PrestudentMultiAssign extends FHC_Controller
|
||||
class PrestudentMultiAssign extends Auth_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
@@ -5,7 +5,7 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class Manager extends FHC_Controller
|
||||
class Manager extends Auth_Controller
|
||||
{
|
||||
/**
|
||||
*
|
||||
|
||||
@@ -6,7 +6,7 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
* Also shows infocenter-related data for a person and its prestudents, enables document and zgv checks,
|
||||
* displays and saves Notizen for a person, logs infocenter-related actions for a person
|
||||
*/
|
||||
class InfoCenter extends FHC_Controller
|
||||
class InfoCenter extends Auth_Controller
|
||||
{
|
||||
// App and Verarbeitungstaetigkeit name for logging
|
||||
const APP = 'infocenter';
|
||||
@@ -21,12 +21,14 @@ class InfoCenter extends FHC_Controller
|
||||
'saveformalgep' => array(
|
||||
'logtype' => 'Action',
|
||||
'name' => 'Document formally checked',
|
||||
'message' => 'Document %s formally checked, set to %s'
|
||||
'message' => 'Document %s formally checked, set to %s',
|
||||
'success' => null
|
||||
),
|
||||
'savezgv' => array(
|
||||
'logtype' => 'Action',
|
||||
'name' => 'ZGV saved',
|
||||
'message' => 'ZGV saved for degree program %s, prestudentid %s'
|
||||
'message' => 'ZGV saved for degree program %s, prestudentid %s',
|
||||
'success' => null
|
||||
),
|
||||
'abgewiesen' => array(
|
||||
'logtype' => 'Processstate',
|
||||
@@ -41,12 +43,14 @@ class InfoCenter extends FHC_Controller
|
||||
'savenotiz' => array(
|
||||
'logtype' => 'Action',
|
||||
'name' => 'Note added',
|
||||
'message' => 'Note with title %s was added'
|
||||
'message' => 'Note with title %s was added',
|
||||
'success' => null
|
||||
),
|
||||
'updatenotiz' => array(
|
||||
'logtype' => 'Action',
|
||||
'name' => 'Note updated',
|
||||
'message' => 'Note with title %s was updated'
|
||||
'message' => 'Note with title %s was updated',
|
||||
'success' => null
|
||||
)
|
||||
);
|
||||
private $uid; // contains the UID of the logged user
|
||||
@@ -59,6 +63,7 @@ class InfoCenter extends FHC_Controller
|
||||
parent::__construct(
|
||||
array(
|
||||
'index' => 'infocenter:r',
|
||||
'infocenterFreigegeben' => 'infocenter:r',
|
||||
'showDetails' => 'infocenter:r',
|
||||
'unlockPerson' => 'infocenter:rw',
|
||||
'saveFormalGeprueft' => 'infocenter:rw',
|
||||
@@ -89,13 +94,26 @@ class InfoCenter extends FHC_Controller
|
||||
$this->load->library('PersonLogLib');
|
||||
$this->load->library('WidgetLib');
|
||||
|
||||
$this->loadPhrases(
|
||||
array(
|
||||
'global',
|
||||
'person',
|
||||
'lehre',
|
||||
'ui',
|
||||
'infocenter',
|
||||
'filter'
|
||||
)
|
||||
);
|
||||
|
||||
$this->_setAuthUID(); // sets property uid
|
||||
|
||||
$this->load->library('PermissionLib');
|
||||
if(!$this->permissionlib->isBerechtigt('basis/person'))
|
||||
show_error('You have no Permission! You need Infocenter Role');
|
||||
|
||||
$this->_setControllerId(); // sets the controller id
|
||||
$this->setControllerId(); // sets the controller id
|
||||
|
||||
$this->fhc_controller_id = $this->getControllerId();
|
||||
|
||||
$this->setNavigationMenuArray(); // sets property navigationMenuArray
|
||||
}
|
||||
@@ -127,46 +145,54 @@ class InfoCenter extends FHC_Controller
|
||||
|
||||
$personexists = $this->PersonModel->load($person_id);
|
||||
|
||||
if(isError($personexists))
|
||||
if (isError($personexists))
|
||||
show_error($personexists->retval);
|
||||
|
||||
if (empty($personexists->retval))
|
||||
show_error('person does not exist!');
|
||||
|
||||
//mark person as locked for editing
|
||||
$result = $this->PersonLockModel->lockPerson($person_id, $this->uid, self::APP);
|
||||
$show_lock_link_get = $this->input->get('show_lock_link');
|
||||
$show_lock_link = !isset($show_lock_link_get) || $show_lock_link_get === '1';
|
||||
|
||||
if(isError($result))
|
||||
show_error($result->retval);
|
||||
if ($show_lock_link)
|
||||
{
|
||||
//mark person as locked for editing
|
||||
$result = $this->PersonLockModel->lockPerson($person_id, $this->uid, self::APP);
|
||||
|
||||
if (isError($result))
|
||||
show_error($result->retval);
|
||||
}
|
||||
|
||||
$persondata = $this->_loadPersonData($person_id);
|
||||
$prestudentdata = $this->_loadPrestudentData($person_id);
|
||||
|
||||
$this->load->view(
|
||||
'system/infocenter/infocenterDetails.php',
|
||||
array_merge(
|
||||
$persondata,
|
||||
$prestudentdata
|
||||
)
|
||||
$data = array_merge(
|
||||
$persondata,
|
||||
$prestudentdata,
|
||||
array('show_lock_link' => $show_lock_link)
|
||||
);
|
||||
|
||||
$data['fhc_controller_id'] = $this->fhc_controller_id;
|
||||
|
||||
$this->load->view('system/infocenter/infocenterDetails.php', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* unlocks page from edit by a person, redirects to overview filter page
|
||||
* Unlocks page from edit by a person, redirects to overview filter page
|
||||
* @param $person_id
|
||||
*/
|
||||
public function unlockPerson($person_id)
|
||||
{
|
||||
$result = $this->PersonLockModel->unlockPerson($person_id, self::APP);
|
||||
|
||||
if(isError($result))
|
||||
if (isError($result))
|
||||
show_error($result->retval);
|
||||
|
||||
redirect(self::URL_PREFIX);
|
||||
redirect(self::URL_PREFIX.'?fhc_controller_id='.$this->fhc_controller_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves if a document has been formal geprueft. saves current timestamp if checked as geprueft, or null if not.
|
||||
* Saves if a document has been formal geprueft. Saves current timestamp if checked as geprueft, or null if not.
|
||||
* @param $person_id
|
||||
*/
|
||||
public function saveFormalGeprueft($person_id)
|
||||
@@ -174,37 +200,36 @@ class InfoCenter extends FHC_Controller
|
||||
$akte_id = $this->input->post('akte_id');
|
||||
$formalgeprueft = $this->input->post('formal_geprueft');
|
||||
|
||||
if (!isset($akte_id) || !isset($formalgeprueft) || !isset($person_id))
|
||||
show_error('Parameters not set!');
|
||||
$json = false;
|
||||
|
||||
$akte = $this->AkteModel->load($akte_id);
|
||||
|
||||
if (isError($akte))
|
||||
if (isset($akte_id) && isset($formalgeprueft) && isset($person_id))
|
||||
{
|
||||
show_error($akte->retval);
|
||||
$akte = $this->AkteModel->load($akte_id);
|
||||
|
||||
if (hasData($akte))
|
||||
{
|
||||
$timestamp = ($formalgeprueft === 'true') ? date('Y-m-d H:i:s') : null;
|
||||
$result = $this->AkteModel->update($akte_id, array('formal_geprueft_amum' => $timestamp));
|
||||
|
||||
if (isSuccess($result))
|
||||
{
|
||||
$json = $timestamp;
|
||||
|
||||
$this->_log(
|
||||
$person_id,
|
||||
'saveformalgep',
|
||||
array(
|
||||
empty($akte->retval[0]->titel) ? $akte->retval[0]->bezeichnung : $akte->retval[0]->titel,
|
||||
is_null($timestamp) ? 'NULL' : $timestamp
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$timestamp = ($formalgeprueft === 'true') ? date('Y-m-d H:i:s') : null;
|
||||
$result = $this->AkteModel->update($akte_id, array('formal_geprueft_amum' => $timestamp));
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
show_error($result->retval);
|
||||
}
|
||||
|
||||
//write person log
|
||||
$this->_log(
|
||||
$person_id,
|
||||
'saveformalgep',
|
||||
array(
|
||||
empty($akte->retval[0]->titel) ? $akte->retval[0]->bezeichnung : $akte->retval[0]->titel,
|
||||
is_null($timestamp) ? 'NULL' : $timestamp
|
||||
)
|
||||
);
|
||||
|
||||
$this->output
|
||||
->set_content_type('application/json')
|
||||
->set_output(json_encode($timestamp));
|
||||
->set_output(json_encode($json));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -215,20 +240,13 @@ class InfoCenter extends FHC_Controller
|
||||
{
|
||||
$prestudent = $this->PrestudentModel->getLastPrestudent($person_id, true);
|
||||
|
||||
if (isError($prestudent))
|
||||
{
|
||||
show_error($prestudent->retval);
|
||||
}
|
||||
|
||||
$jsonoutput = count($prestudent->retval) > 0 ? $prestudent->retval[0] : null;
|
||||
|
||||
$this->output
|
||||
->set_content_type('application/json')
|
||||
->set_output(json_encode($jsonoutput));
|
||||
->set_output(json_encode($prestudent));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets Zugangsvoraussetzungen for a prestudents as a description text
|
||||
* Gets Zugangsvoraussetzungen for a prestudent as a description text and shows them in a view
|
||||
* @param $prestudent_id
|
||||
*/
|
||||
public function getZgvInfoForPrestudent($prestudent_id)
|
||||
@@ -239,67 +257,73 @@ class InfoCenter extends FHC_Controller
|
||||
$studiengangkurzbz = $prestudentdata['studiengang_kurzbz'];
|
||||
$studiengangbezeichnung = $prestudentdata['studiengang_bezeichnung'];
|
||||
|
||||
$data = array('studiengang_bezeichnung' => $studiengangbezeichnung, 'studiengang_kurzbz' => $studiengangkurzbz, 'data' => null);
|
||||
$data = array(
|
||||
'studiengang_bezeichnung' => $studiengangbezeichnung,
|
||||
'studiengang_kurzbz' => $studiengangkurzbz,
|
||||
'data' => null
|
||||
);
|
||||
|
||||
if (hasData($studienordnung))
|
||||
{
|
||||
$data['data'] = $studienordnung->retval[0]->data;
|
||||
}
|
||||
|
||||
$this->load->view('system/infocenter/studiengangZgvInfo.php',
|
||||
$data
|
||||
);
|
||||
$this->load->view('system/infocenter/studiengangZgvInfo.php', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves a zgv for a prestudent. includes Ort, Datum, Nation for bachelor and master.
|
||||
* Saves a ZGV for a prestudent, includes Ort, Datum, Nation for bachelor and master
|
||||
* @param $prestudent_id
|
||||
*/
|
||||
public function saveZgvPruefung($prestudent_id)
|
||||
public function saveZgvPruefung()
|
||||
{
|
||||
// zgvdata
|
||||
// Check for string null, in case dropdown changed to default value
|
||||
$zgv_code = $this->input->post('zgv') === 'null' ? null : $this->input->post('zgv');
|
||||
$zgvort = $this->input->post('zgvort');
|
||||
$zgvdatum = $this->input->post('zgvdatum');
|
||||
$zgvdatum = empty($zgvdatum) ? null : date_format(date_create($zgvdatum), 'Y-m-d');
|
||||
$zgvnation_code = $this->input->post('zgvnation') === 'null' ? null : $this->input->post('zgvnation');
|
||||
$prestudent_id = $this->input->post('prestudentid');
|
||||
|
||||
//zgvmasterdata
|
||||
$zgvmas_code = $this->input->post('zgvmas') === 'null' ? null : $this->input->post('zgvmas');
|
||||
$zgvmaort = $this->input->post('zgvmaort');
|
||||
$zgvmadatum = $this->input->post('zgvmadatum');
|
||||
$zgvmadatum = empty($zgvmadatum) ? null : date_format(date_create($zgvmadatum), 'Y-m-d');
|
||||
$zgvmanation_code = $this->input->post('zgvmanation') === 'null' ? null : $this->input->post('zgvmanation');
|
||||
|
||||
$result = $this->PrestudentModel->update(
|
||||
$prestudent_id,
|
||||
array(
|
||||
'zgv_code' => $zgv_code,
|
||||
'zgvort' => $zgvort,
|
||||
'zgvdatum' => $zgvdatum,
|
||||
'zgvnation' => $zgvnation_code,
|
||||
'zgvmas_code' => $zgvmas_code,
|
||||
'zgvmaort' => $zgvmaort,
|
||||
'zgvmadatum' => $zgvmadatum,
|
||||
'zgvmanation' => $zgvmanation_code,
|
||||
'updateamum' => date('Y-m-d H:i:s')
|
||||
)
|
||||
);
|
||||
|
||||
if (isError($result))
|
||||
if (empty($prestudent_id))
|
||||
$result = error('Prestudentid missing');
|
||||
else
|
||||
{
|
||||
show_error($result->retval);
|
||||
// zgvdata
|
||||
// Check for string null, in case dropdown changed to default value
|
||||
$zgv_code = $this->input->post('zgv') === 'null' ? null : $this->input->post('zgv');
|
||||
$zgvort = $this->input->post('zgvort');
|
||||
$zgvdatum = $this->input->post('zgvdatum');
|
||||
$zgvdatum = empty($zgvdatum) ? null : date_format(date_create($zgvdatum), 'Y-m-d');
|
||||
$zgvnation_code = $this->input->post('zgvnation') === 'null' ? null : $this->input->post('zgvnation');
|
||||
|
||||
//zgvmasterdata
|
||||
$zgvmas_code = $this->input->post('zgvmas') === 'null' ? null : $this->input->post('zgvmas');
|
||||
$zgvmaort = $this->input->post('zgvmaort');
|
||||
$zgvmadatum = $this->input->post('zgvmadatum');
|
||||
$zgvmadatum = empty($zgvmadatum) ? null : date_format(date_create($zgvmadatum), 'Y-m-d');
|
||||
$zgvmanation_code = $this->input->post('zgvmanation') === 'null' ? null : $this->input->post('zgvmanation');
|
||||
|
||||
$result = $this->PrestudentModel->update(
|
||||
$prestudent_id,
|
||||
array(
|
||||
'zgv_code' => $zgv_code,
|
||||
'zgvort' => $zgvort,
|
||||
'zgvdatum' => $zgvdatum,
|
||||
'zgvnation' => $zgvnation_code,
|
||||
'zgvmas_code' => $zgvmas_code,
|
||||
'zgvmaort' => $zgvmaort,
|
||||
'zgvmadatum' => $zgvmadatum,
|
||||
'zgvmanation' => $zgvmanation_code,
|
||||
'updateamum' => date('Y-m-d H:i:s')
|
||||
)
|
||||
);
|
||||
|
||||
if (isSuccess($result))
|
||||
{
|
||||
//get extended Prestudent data for logging
|
||||
$logdata = $this->_getPersonAndStudiengangFromPrestudent($prestudent_id);
|
||||
|
||||
$this->_log($logdata['person_id'], 'savezgv', array($logdata['studiengang_kurzbz'], $prestudent_id));
|
||||
}
|
||||
}
|
||||
|
||||
//get extended Prestudent data for logging
|
||||
$logdata = $this->_getPersonAndStudiengangFromPrestudent($prestudent_id);
|
||||
|
||||
$this->_log($logdata['person_id'], 'savezgv', array($logdata['studiengang_kurzbz'], $prestudent_id));
|
||||
|
||||
$this->output
|
||||
->set_content_type('application/json')
|
||||
->set_output(json_encode($result->retval));
|
||||
->set_output(json_encode($result));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -310,6 +334,7 @@ class InfoCenter extends FHC_Controller
|
||||
public function saveAbsage($prestudent_id)
|
||||
{
|
||||
$statusgrund = $this->input->post('statusgrund');
|
||||
$this->fhc_controller_id = $this->input->post('fhc_controller_id');
|
||||
|
||||
$lastStatus = $this->PrestudentstatusModel->getLastStatus($prestudent_id);
|
||||
|
||||
@@ -420,7 +445,8 @@ class InfoCenter extends FHC_Controller
|
||||
|
||||
$result = $this->DokumentprestudentModel->setAcceptedDocuments($prestudent_id, $dokument_kurzbzs);
|
||||
|
||||
if (isError($result))
|
||||
//returns null if no documents to accept
|
||||
if ($result !== null && isError($result))
|
||||
{
|
||||
show_error($result->retval);
|
||||
}
|
||||
@@ -446,16 +472,14 @@ class InfoCenter extends FHC_Controller
|
||||
|
||||
$result = $this->NotizModel->addNotizForPerson($person_id, $titel, $text, $erledigt, $this->uid);
|
||||
|
||||
if (isError($result))
|
||||
if (isSuccess($result))
|
||||
{
|
||||
show_error($result->retval);
|
||||
$this->_log($person_id, 'savenotiz', array($titel));
|
||||
}
|
||||
|
||||
$this->_log($person_id, 'savenotiz', array($titel));
|
||||
|
||||
$this->output
|
||||
->set_content_type('application/json')
|
||||
->set_output(json_encode($result->retval));
|
||||
->set_output(json_encode($result));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -480,20 +504,15 @@ class InfoCenter extends FHC_Controller
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
$json = FALSE;
|
||||
|
||||
if (isSuccess($result))
|
||||
{
|
||||
$json = TRUE;
|
||||
|
||||
//set log "Notiz updated"
|
||||
$this->_log($person_id, 'updatenotiz', array($titel));
|
||||
}
|
||||
|
||||
$this->output
|
||||
->set_content_type('application/json')
|
||||
->set_output(json_encode($json));
|
||||
->set_output(json_encode($result));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -550,6 +569,69 @@ class InfoCenter extends FHC_Controller
|
||||
->_display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the date until which a person is parked
|
||||
* @param $person_id
|
||||
*/
|
||||
public function getParkedDate($person_id)
|
||||
{
|
||||
$result = $this->personloglib->getParkedDate($person_id);
|
||||
|
||||
$this->output
|
||||
->set_content_type('application/json')
|
||||
->set_output(json_encode($result));
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes parking of a person, i.e. a person is not expected to do any actions while parked
|
||||
*/
|
||||
public function park()
|
||||
{
|
||||
$person_id = $this->input->post('person_id');
|
||||
$date = $this->input->post('parkdate');
|
||||
|
||||
$result = $this->personloglib->park($person_id, date_format(date_create($date), 'Y-m-d'), self::TAETIGKEIT, self::APP, null, $this->uid);
|
||||
|
||||
$this->output
|
||||
->set_content_type('application/json')
|
||||
->set_output(json_encode($result));
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes parking of a person
|
||||
*/
|
||||
public function unPark()
|
||||
{
|
||||
$person_id = $this->input->post('person_id');
|
||||
|
||||
$result = $this->personloglib->unPark($person_id);
|
||||
|
||||
$this->output
|
||||
->set_content_type('application/json')
|
||||
->set_output(json_encode($result));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the End date of the current Studienjahr
|
||||
*/
|
||||
public function getStudienjahrEnd()
|
||||
{
|
||||
$this->load->model('organisation/studienjahr_model', 'StudienjahrModel');
|
||||
|
||||
$result = $this->StudienjahrModel->getCurrStudienjahr();
|
||||
|
||||
$json = false;
|
||||
|
||||
if (hasData($result))
|
||||
{
|
||||
$json = $result->retval[0]->ende;
|
||||
}
|
||||
|
||||
$this->output
|
||||
->set_content_type('application/json')
|
||||
->set_output(json_encode($json));
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
@@ -607,13 +689,13 @@ class InfoCenter extends FHC_Controller
|
||||
$filtersarray = array(
|
||||
'abgeschickt' => array(
|
||||
'link' => '#',
|
||||
'description' => 'Abgeschickt',
|
||||
'description' => ucfirst($this->p->t('global', 'abgeschickt')),
|
||||
'expand' => true,
|
||||
'children' => array()
|
||||
),
|
||||
'nichtabgeschickt' => array(
|
||||
'link' => '#',
|
||||
'description' => 'Nicht abgeschickt',
|
||||
'description' => ucfirst($this->p->t('global', 'nichtAbgeschickt')),
|
||||
'expand' => true,
|
||||
'children' => array()
|
||||
)
|
||||
@@ -660,14 +742,26 @@ class InfoCenter extends FHC_Controller
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrapper for setNavigationMenu, returns JSON message
|
||||
*/
|
||||
public function setNavigationMenuArrayJson()
|
||||
{
|
||||
$this->setNavigationMenuArray();
|
||||
|
||||
$this->output
|
||||
->set_content_type('application/json')
|
||||
->set_output(json_encode(success('success')));
|
||||
}
|
||||
|
||||
private function _fillFilters($filters, &$tofill)
|
||||
{
|
||||
foreach ($filters as $filterId => $description)
|
||||
{
|
||||
$toPrint = "%s?%s=%s&%s=%s";
|
||||
$toPrint = "%s?%s=%s";
|
||||
|
||||
$tofill['children'][] = array(
|
||||
'link' => sprintf($toPrint, site_url('system/infocenter/InfoCenter'), 'filter_id', $filterId, 'fhc_controller_id', $this->fhc_controller_id),
|
||||
'link' => sprintf($toPrint, site_url('system/infocenter/InfoCenter'), 'filter_id', $filterId),
|
||||
'description' => $description
|
||||
);
|
||||
}
|
||||
@@ -677,13 +771,13 @@ class InfoCenter extends FHC_Controller
|
||||
{
|
||||
foreach ($filters as $filterId => $description)
|
||||
{
|
||||
$toPrint = "%s?%s=%s&%s=%s";
|
||||
$toPrint = "%s?%s=%s";
|
||||
|
||||
$tofill['children'][] = array(
|
||||
'link' => sprintf($toPrint, site_url('system/infocenter/InfoCenter'), 'filter_id', $filterId, 'fhc_controller_id', $this->fhc_controller_id),
|
||||
'link' => sprintf($toPrint, site_url('system/infocenter/InfoCenter'), 'filter_id', $filterId),
|
||||
'description' => $description,
|
||||
'subscriptDescription' => 'Remove',
|
||||
'subscriptLinkClass' => 'remove-filter',
|
||||
'subscriptLinkClass' => 'remove-custom-filter',
|
||||
'subscriptLinkValue' => $filterId
|
||||
);
|
||||
}
|
||||
@@ -769,7 +863,7 @@ class InfoCenter extends FHC_Controller
|
||||
show_error($user_person->retval);
|
||||
}
|
||||
|
||||
$messagelink = base_url('/index.ci.php/system/Messages/write/'.$user_person->retval[0]->person_id);
|
||||
$messagelink = site_url('/system/Messages/write/'.$user_person->retval[0]->person_id);
|
||||
|
||||
$data = array (
|
||||
'lockedby' => $lockedby,
|
||||
@@ -871,7 +965,7 @@ class InfoCenter extends FHC_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.'?fhc_controller_id='.$this->fhc_controller_id.'#'.$section);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -905,15 +999,20 @@ class InfoCenter extends FHC_Controller
|
||||
{
|
||||
$logdata = $this->logparams[$logname];
|
||||
|
||||
$datatolog = array(
|
||||
'name' => $logdata['name']
|
||||
);
|
||||
|
||||
if (isset($logdata['message']))
|
||||
$datatolog['message'] = vsprintf($logdata['message'], $messageparams);
|
||||
|
||||
if (array_key_exists('success', $logdata))
|
||||
$datatolog['success'] = true;
|
||||
|
||||
$this->personloglib->log(
|
||||
$person_id,
|
||||
$logdata['logtype'],
|
||||
array(
|
||||
'name' => $logdata['name'],
|
||||
'message' => vsprintf($logdata['message'],
|
||||
$messageparams),
|
||||
'success' => 'true'
|
||||
),
|
||||
$datatolog,
|
||||
self::TAETIGKEIT,
|
||||
self::APP,
|
||||
null,
|
||||
@@ -1019,7 +1118,7 @@ class InfoCenter extends FHC_Controller
|
||||
if (!empty($receiver))
|
||||
{
|
||||
//Freigabeinformationmail sent from default system mail to studiengang mail(s)
|
||||
$sent = $this->maillib->send('', $receiver, $subject, $email);
|
||||
$sent = $this->maillib->send('', $receiver, $subject, $email, '', null, null, 'Bitte sehen Sie sich die Nachricht in HTML Sicht an, um den Inhalt vollständig darzustellen.');
|
||||
|
||||
if (!$sent)
|
||||
$this->loglib->logError('Error when sending Freigabe mail');
|
||||
@@ -1029,21 +1128,4 @@ class InfoCenter extends FHC_Controller
|
||||
$this->loglib->logError('Studiengang has no mail for sending Freigabe mail');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the unique id for the called controller
|
||||
*/
|
||||
private function _setControllerId()
|
||||
{
|
||||
$fhc_controller_id = $this->input->get('fhc_controller_id');
|
||||
|
||||
if (!isset($fhc_controller_id) || empty($fhc_controller_id))
|
||||
{
|
||||
$fhc_controller_id = uniqid();
|
||||
header('Location: '.$_SERVER['REQUEST_URI'].'?fhc_controller_id='.$fhc_controller_id);
|
||||
exit;
|
||||
}
|
||||
|
||||
$this->fhc_controller_id = $fhc_controller_id;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Auth_Controller extends FHC_Controller
|
||||
{
|
||||
/**
|
||||
* Extends this controller if authentication is required
|
||||
*/
|
||||
public function __construct($requiredPermissions)
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
// Loads authentication helper
|
||||
$this->load->helper('fhcauth');
|
||||
|
||||
// Checks if the caller is allowed to access to this content
|
||||
$this->_isAllowed($requiredPermissions);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the caller is allowed to access to this content with the given permissions
|
||||
* If it is not allowed will set the HTTP header with code 401
|
||||
* Wrapper for _checkPermissions
|
||||
*/
|
||||
private function _isAllowed($requiredPermissions)
|
||||
{
|
||||
// Loads permission lib
|
||||
$this->load->library('PermissionLib');
|
||||
|
||||
if (!$this->permissionlib->isEntitled($requiredPermissions, $this->router->method))
|
||||
{
|
||||
header('HTTP/1.0 401 Unauthorized');
|
||||
echo 'You are not allowed to access to this content';
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,45 +4,101 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class FHC_Controller extends CI_Controller
|
||||
{
|
||||
const FHC_CONTROLLER_ID = 'fhc_controller_id'; // name of the parameter used to identify uniquely a call to a controller
|
||||
|
||||
private $_controllerId; // contains the unique identifier of a call to a controller
|
||||
|
||||
/**
|
||||
* Standard construct for all the controllers, loads the authentication system
|
||||
* Checks the caller permissions
|
||||
* Standard construct for all the controllers
|
||||
*/
|
||||
public function __construct($requiredPermissions)
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
// Loads authentication helper
|
||||
$this->load->helper('fhcauth');
|
||||
|
||||
// Loads permission lib
|
||||
$this->load->library('PermissionLib');
|
||||
|
||||
$this->_isAllowed($requiredPermissions);
|
||||
// Set _controllerId as null by default
|
||||
$this->_controllerId = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the caller is allowed to access to this content with the given permissions
|
||||
* If it is not allowed will set the HTTP header with code 401
|
||||
* Wrapper for _checkPermissions
|
||||
*/
|
||||
private function _isAllowed($requiredPermissions)
|
||||
{
|
||||
if (!$this->permissionlib->isEntitled($requiredPermissions, $this->router->method))
|
||||
{
|
||||
header('HTTP/1.0 401 Unauthorized');
|
||||
echo 'You are not allowed to access to this content';
|
||||
exit;
|
||||
}
|
||||
}
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* Wrapper to load phrases using the PhrasesLib
|
||||
* NOTE: The library is loaded with the alias 'p', so must me used with this alias in the rest of the code.
|
||||
* EX: $this->p->t(<category>, <phrase name>)
|
||||
*/
|
||||
public function loadPhrases($categories, $language = null)
|
||||
protected function loadPhrases($categories, $language = null)
|
||||
{
|
||||
$this->load->library('PhrasesLib', array($categories, $language), 'p');
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Protected methods
|
||||
|
||||
/**
|
||||
* Sets the unique id for the called controller
|
||||
* NOTE: it is only working with HTTP GET request, not neeaded with POST
|
||||
* because the first call to the controller is via HTTP GET,
|
||||
* therefore a fhc_controller_id is already generated
|
||||
*/
|
||||
protected function setControllerId()
|
||||
{
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'GET')
|
||||
{
|
||||
$this->_controllerId = $this->input->get(self::FHC_CONTROLLER_ID);
|
||||
|
||||
if (!isset($this->_controllerId) || empty($this->_controllerId))
|
||||
{
|
||||
$this->_controllerId = uniqid(); // generate a unique id
|
||||
// Redirect to the same URL, but giving FHC_CONTROLLER_ID as HTTP GET parameter
|
||||
header(
|
||||
sprintf(
|
||||
'Location: %s%s%s=%s',
|
||||
$_SERVER['REQUEST_URI'],
|
||||
strpos($_SERVER['REQUEST_URI'], '?') === false ? '?' : '&', // place the corret character to divide parameters
|
||||
self::FHC_CONTROLLER_ID,
|
||||
$this->_controllerId
|
||||
)
|
||||
);
|
||||
exit; // terminate immediately the execution of this controller
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the value of the property _controllerId
|
||||
*/
|
||||
protected function getControllerId()
|
||||
{
|
||||
return $this->_controllerId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Utility method to output a success using JSON as content type
|
||||
* Wraps the private method _outputJson
|
||||
*/
|
||||
protected function outputJsonSuccess($mixed)
|
||||
{
|
||||
$this->_outputJson(success($mixed));
|
||||
}
|
||||
|
||||
/**
|
||||
* Utility method to output an error using JSON as content type
|
||||
* Wraps the private method _outputJson
|
||||
*/
|
||||
protected function outputJsonError($mixed)
|
||||
{
|
||||
$this->_outputJson(error($mixed));
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
/**
|
||||
* Utility method to output using JSON as content type
|
||||
*/
|
||||
private function _outputJson($mixed)
|
||||
{
|
||||
$this->output->set_content_type('application/json')->set_output(json_encode($mixed));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,8 +57,19 @@ class DocumentLib
|
||||
case 'application/vnd.ms-word':
|
||||
case 'application/vnd.oasis.opendocument.text':
|
||||
case 'text/plain':
|
||||
$this->convert($filename, $outFile, 'pdf');
|
||||
return success($outFile);
|
||||
// Unoconv Version 0.6 seems to fail on converting TXT Files
|
||||
if ($this->unoconv_version == '0.6')
|
||||
return error();
|
||||
|
||||
$ret = $this->convert($filename, $outFile, 'pdf');
|
||||
if(isSuccess($ret))
|
||||
{
|
||||
return success($outFile);
|
||||
}
|
||||
else
|
||||
{
|
||||
return error($ret->retval);
|
||||
}
|
||||
case 'application/pdf':
|
||||
return success($filename);
|
||||
default:
|
||||
|
||||
@@ -0,0 +1,864 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* FilterWidget logic
|
||||
*/
|
||||
class FiltersLib
|
||||
{
|
||||
// Session parameters names
|
||||
const SESSION_NAME = 'FHC_FILTER_WIDGET'; // Filter session name
|
||||
const SESSION_FILTER_NAME = 'filterName';
|
||||
const SESSION_FIELDS = 'fields';
|
||||
const SESSION_SELECTED_FIELDS = 'selectedFields';
|
||||
const SESSION_COLUMNS_ALIASES = 'columnsAliases';
|
||||
const SESSION_ADDITIONAL_COLUMNS = 'additionalColumns';
|
||||
const SESSION_CHECKBOXES = 'checkboxes';
|
||||
const SESSION_FILTERS = 'filters';
|
||||
const SESSION_METADATA = 'datasetMetadata';
|
||||
const SESSION_DATASET = 'dataset';
|
||||
const SESSION_ROW_NUMBER = 'rowNumber';
|
||||
const SESSION_RELOAD_DATASET = 'reloadDataset';
|
||||
|
||||
// Alias for the dynamic table used to retrive the dataset
|
||||
const DATASET_TABLE_ALIAS = 'datasetFilterTable';
|
||||
|
||||
// Parameters names...
|
||||
// ...to identify a single filter widget in the session
|
||||
const FHC_CONTROLLER_ID = 'fhc_controller_id';
|
||||
|
||||
// ...to identify a single filter widget in the DB
|
||||
const FILTER_ID = 'filter_id';
|
||||
const APP_PARAMETER = 'app';
|
||||
const DATASET_NAME_PARAMETER = 'datasetName';
|
||||
const FILTER_KURZBZ_PARAMETER = 'filterKurzbz';
|
||||
|
||||
// ...to specify permissions that are needed to use this FilterWidget
|
||||
const REQUIRED_PERMISSIONS_PARAMETER = 'requiredPermissions';
|
||||
|
||||
// ...stament to retrive the dataset
|
||||
const QUERY_PARAMETER = 'query';
|
||||
|
||||
// ...to specify more columns or aliases for them
|
||||
const ADDITIONAL_COLUMNS = 'additionalColumns';
|
||||
const CHECKBOXES = 'checkboxes';
|
||||
const COLUMNS_ALIASES = 'columnsAliases';
|
||||
|
||||
// ...to format/mark records of a dataset
|
||||
const FORMAT_ROW = 'formatRow';
|
||||
const MARK_ROW = 'markRow';
|
||||
|
||||
// ...to hide the options for a filter
|
||||
const HIDE_HEADER = 'hideHeader';
|
||||
const HIDE_SAVE = 'hideSave';
|
||||
|
||||
// Filter operations values
|
||||
const OP_EQUAL = 'equal';
|
||||
const OP_NOT_EQUAL = 'nequal';
|
||||
const OP_GREATER_THAN = 'gt';
|
||||
const OP_LESS_THAN = 'lt';
|
||||
const OP_IS_TRUE = 'true';
|
||||
const OP_IS_FALSE = 'false';
|
||||
const OP_CONTAINS = 'contains';
|
||||
const OP_NOT_CONTAINS = 'ncontains';
|
||||
const OP_SET = 'set';
|
||||
const OP_NOT_SET = 'nset';
|
||||
|
||||
// Filter options values
|
||||
const OPT_DAYS = 'days';
|
||||
const OPT_MONTHS = 'months';
|
||||
|
||||
const FILTER_PHRASES_CATEGORY = 'FilterWidget'; // The category used to store phrases for the FilterWidget
|
||||
|
||||
const FILTER_PAGE_PARAM = 'filter_page'; // Filter page parameter used to overwrite the page URI
|
||||
|
||||
const PERMISSION_FILTER_METHOD = 'FilterWidget'; // Name for fake method to be checked by the PermissionLib
|
||||
const PERMISSION_TYPE = 'rw';
|
||||
|
||||
private $_ci; // Code igniter instance
|
||||
private $_filterUniqueId; // unique id for this filter widget
|
||||
|
||||
/**
|
||||
* Gets the CI instance and loads message helper
|
||||
*/
|
||||
public function __construct($params = null)
|
||||
{
|
||||
$this->_ci =& get_instance();
|
||||
|
||||
// Loads helper message to manage returning messages
|
||||
$this->_ci->load->helper('message');
|
||||
|
||||
$this->_filterUniqueId = $this->_getFilterUniqueId($params); // sets the id for the related filter widget
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* Checks if at least one of the permissions given as parameter (requiredPermissions) belongs
|
||||
* to the authenticated user, if confirmed then is allowed to use this FilterWidget.
|
||||
* If the parameter requiredPermissions is NOT given, then no one is allow to use this FilterWidget
|
||||
*/
|
||||
public function isAllowed($requiredPermissions = null)
|
||||
{
|
||||
$this->_ci->load->library('PermissionLib'); // Load permission library
|
||||
|
||||
$isAllowed = false; // by default is not allowed
|
||||
|
||||
// Gets the required permissions from the session if they are not provided as parameter
|
||||
$rq = $requiredPermissions;
|
||||
if ($rq == null) $rq = $this->getElementSession(self::REQUIRED_PERMISSIONS_PARAMETER);
|
||||
|
||||
// If the parameter requiredPermissions is NOT given, then no one is allow to use this FilterWidget
|
||||
if ($rq != null)
|
||||
{
|
||||
// If requiredPermissions is NOT an array then converts it to an array
|
||||
if (!is_array($rq))
|
||||
{
|
||||
$rq = array($rq);
|
||||
}
|
||||
|
||||
// Checks if at least one of the permissions given as parameter belongs to the authenticated user...
|
||||
for ($p = 0; $p < count($rq); $p++)
|
||||
{
|
||||
$isAllowed = $this->_ci->permissionlib->isEntitled(
|
||||
array(
|
||||
self::PERMISSION_FILTER_METHOD => $rq[$p].':'.self::PERMISSION_TYPE
|
||||
),
|
||||
self::PERMISSION_FILTER_METHOD
|
||||
);
|
||||
|
||||
if ($isAllowed) break; // ...if confirmed then is allowed to use this FilterWidget
|
||||
}
|
||||
}
|
||||
|
||||
return $isAllowed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the whole session for this filter widget if found, otherwise null
|
||||
*/
|
||||
public function getSession()
|
||||
{
|
||||
$session = null;
|
||||
|
||||
// If it is present a session for this filter
|
||||
if (isset($_SESSION[self::SESSION_NAME]) && isset($_SESSION[self::SESSION_NAME][$this->_filterUniqueId]))
|
||||
{
|
||||
$session = $_SESSION[self::SESSION_NAME][$this->_filterUniqueId];
|
||||
}
|
||||
|
||||
return $session;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns one element from the session of this filter widget, otherwise null
|
||||
*/
|
||||
public function getElementSession($name)
|
||||
{
|
||||
$session = $this->getSession(); // get the whole session for this filter
|
||||
|
||||
if (isset($session[$name]))
|
||||
{
|
||||
return $session[$name];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the whole session for this filter widget
|
||||
*/
|
||||
public function setSession($data)
|
||||
{
|
||||
// If is NOT already present into the session
|
||||
if (!isset($_SESSION[self::SESSION_NAME])
|
||||
|| (isset($_SESSION[self::SESSION_NAME]) && !is_array($_SESSION[self::SESSION_NAME])))
|
||||
{
|
||||
$_SESSION[self::SESSION_NAME] = array(); // then create it
|
||||
}
|
||||
|
||||
$_SESSION[self::SESSION_NAME][$this->_filterUniqueId] = $data; // stores data
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets one element of the session of this filter widget
|
||||
*/
|
||||
public function setElementSession($name, $value)
|
||||
{
|
||||
// If is NOT already present into the session
|
||||
if (!isset($_SESSION[self::SESSION_NAME])
|
||||
|| (isset($_SESSION[self::SESSION_NAME]) && !is_array($_SESSION[self::SESSION_NAME])))
|
||||
{
|
||||
$_SESSION[self::SESSION_NAME] = array(); // then create it
|
||||
}
|
||||
|
||||
// If the session for this filter is NOT already present into the session
|
||||
if (!isset($_SESSION[self::SESSION_NAME][$this->_filterUniqueId])
|
||||
|| (isset($_SESSION[self::SESSION_NAME][$this->_filterUniqueId])
|
||||
&& !is_array($_SESSION[self::SESSION_NAME][$this->_filterUniqueId])))
|
||||
{
|
||||
$_SESSION[self::SESSION_NAME][$this->_filterUniqueId] = array(); // then create it
|
||||
}
|
||||
|
||||
$_SESSION[self::SESSION_NAME][$this->_filterUniqueId][$name] = $value; // stores the single value
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the definition data from DB for a filter widget
|
||||
*/
|
||||
public function loadDefinition($filterId, $app, $datasetName, $filterKurzbz)
|
||||
{
|
||||
// Loads the needed models
|
||||
$this->_ci->load->model('system/Filters_model', 'FiltersModel');
|
||||
$this->_ci->load->model('person/Benutzer_model', 'BenutzerModel'); // to get the default custom filter
|
||||
|
||||
$this->_ci->FiltersModel->resetQuery(); // reset any previous built query
|
||||
|
||||
$this->_ci->FiltersModel->addJoin('public.tbl_benutzer', 'person_id', 'LEFT'); // left join with benutzer table
|
||||
$this->_ci->FiltersModel->addSelect('system.tbl_filters.*'); // select only from table filters
|
||||
$this->_ci->FiltersModel->addOrder('sort', 'ASC'); // sort on column sort
|
||||
$this->_ci->FiltersModel->addLimit(1); // if more than one filter is set as default only one will be retrived
|
||||
|
||||
$definition = null;
|
||||
$whereParameters = null; // where clause parameters
|
||||
|
||||
// If we have a good filterId then use it!
|
||||
if ($filterId != null && is_numeric($filterId) && $filterId > 0)
|
||||
{
|
||||
$whereParameters = array(
|
||||
'filter_id' => $filterId
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
// If we can univocally retrive a filter
|
||||
if ($app != null && $datasetName != null && $filterKurzbz != null)
|
||||
{
|
||||
$whereParameters = array(
|
||||
'app' => $app,
|
||||
'dataset_name' => $datasetName,
|
||||
'filter_kurzbz' => $filterKurzbz
|
||||
);
|
||||
}
|
||||
// Else if we have only app and datasetName
|
||||
elseif ($app != null && $datasetName != null && $filterKurzbz == null)
|
||||
{
|
||||
// Try to load the custom filter (person_id = logged user person_id) with the given "app" and "dataset_name"
|
||||
// that is set as default filter (default_filter = true)
|
||||
$whereParameters = array(
|
||||
'app' => $app,
|
||||
'dataset_name' => $datasetName,
|
||||
'uid' => getAuthUID(),
|
||||
'default_filter' => true
|
||||
);
|
||||
|
||||
$definition = $this->_ci->FiltersModel->loadWhere($whereParameters);
|
||||
if (!hasData($definition)) // If a custom filter is NOT found
|
||||
{
|
||||
// Try to load the global filter (person_id = null) with the given "app" and "dataset_name" that is set as
|
||||
// default filter (default_filter = true)
|
||||
$whereParameters = array(
|
||||
'app' => $app,
|
||||
'dataset_name' => $datasetName,
|
||||
'default_filter' => true
|
||||
);
|
||||
|
||||
$definition = $this->_ci->FiltersModel->loadWhere($whereParameters);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If no definition where loaded and where parameters were set
|
||||
if ($definition == null && $whereParameters != null)
|
||||
{
|
||||
$definition = $this->_ci->FiltersModel->loadWhere($whereParameters);
|
||||
}
|
||||
|
||||
return $definition;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the json definition of this filter is valid
|
||||
*/
|
||||
public function parseFilterJson($definition)
|
||||
{
|
||||
$jsonEncodedFilter = null;
|
||||
|
||||
// If the definition contains data and they are valid
|
||||
if (hasData($definition) && isset($definition->retval[0]->filter) && trim($definition->retval[0]->filter) != '')
|
||||
{
|
||||
// Get the json definition of the filter
|
||||
$tmpJsonEncodedFilter = json_decode($definition->retval[0]->filter);
|
||||
|
||||
// Checks required filter's properies
|
||||
if (isset($tmpJsonEncodedFilter->name)
|
||||
&& isset($tmpJsonEncodedFilter->columns)
|
||||
&& is_array($tmpJsonEncodedFilter->columns)
|
||||
&& isset($tmpJsonEncodedFilter->filters)
|
||||
&& is_array($tmpJsonEncodedFilter->filters))
|
||||
{
|
||||
$jsonEncodedFilter = $tmpJsonEncodedFilter;
|
||||
}
|
||||
}
|
||||
|
||||
return $jsonEncodedFilter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate the query to retrive the dataset for a filter
|
||||
*/
|
||||
public function generateDatasetQuery($query, $filters)
|
||||
{
|
||||
$datasetQuery = null;
|
||||
|
||||
// If the given query is valid and the parameter filters is an array
|
||||
if (!empty(trim($query)) && $filters != null && is_array($filters))
|
||||
{
|
||||
$where = ''; // starts building the SQL where clause
|
||||
|
||||
// Loops through the given applied filters
|
||||
for ($filtersCounter = 0; $filtersCounter < count($filters); $filtersCounter++)
|
||||
{
|
||||
$filterDefinition = $filters[$filtersCounter]; // definition of one filter
|
||||
|
||||
if ($filtersCounter > 0) $where .= ' AND '; // if it's NOT the last one
|
||||
|
||||
if (!empty(trim($filterDefinition->name))) // if the name of the applied filter is valid
|
||||
{
|
||||
// ...build the condition
|
||||
$where .= '"'.$filterDefinition->name.'"'.$this->_getDatasetQueryCondition($filterDefinition);
|
||||
}
|
||||
}
|
||||
|
||||
if ($where != '') // if the SQL where clause was built
|
||||
{
|
||||
$datasetQuery = 'SELECT * FROM ('.$query.') '.self::DATASET_TABLE_ALIAS.' WHERE '.$where;
|
||||
}
|
||||
}
|
||||
|
||||
return $datasetQuery;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrives the dataset from the DB
|
||||
*/
|
||||
public function getDataset($datasetQuery)
|
||||
{
|
||||
$dataset = null;
|
||||
|
||||
if ($datasetQuery != null)
|
||||
{
|
||||
// Execute the given SQL statement suppressing error messages
|
||||
$dataset = @$this->_ci->FiltersModel->execReadOnlyQuery($datasetQuery);
|
||||
}
|
||||
|
||||
return $dataset;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the filter name, the default is the "name" property of the JSON definition
|
||||
* If the property namePhrase is present into the JSON definition, then try to load that from the phrases system
|
||||
* NOTE: filterJson should be already checked using the method parseFilterJson
|
||||
*/
|
||||
public function getFilterName($filterJson)
|
||||
{
|
||||
$filterName = $filterJson->name; // always present, used as default
|
||||
|
||||
// Filter name from phrases system
|
||||
if (isset($filterJson->namePhrase) && !empty(trim($filterJson->namePhrase)))
|
||||
{
|
||||
// Loads the library to use the phrases system
|
||||
$this->_ci->load->library('PhrasesLib', array(self::FILTER_PHRASES_CATEGORY));
|
||||
|
||||
$tmpFilterNamePhrase = $this->_ci->phraseslib->t(self::FILTER_PHRASES_CATEGORY, $filterJson->namePhrase);
|
||||
if (isset($tmpFilterNamePhrase) && !empty(trim($tmpFilterNamePhrase))) // if is not null or an empty string
|
||||
{
|
||||
$filterName = $tmpFilterNamePhrase;
|
||||
}
|
||||
}
|
||||
|
||||
return $filterName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Change the sort of the selected fields of the current filter
|
||||
*/
|
||||
public function sortSelectedFields($selectedFields)
|
||||
{
|
||||
$sortSelectedFields = false;
|
||||
|
||||
// Checks the parameter selectedFields
|
||||
if (isset($selectedFields) && is_array($selectedFields) && count($selectedFields) > 0)
|
||||
{
|
||||
// Retrives all the used fields by the current filter
|
||||
$fields = $this->getElementSession(self::SESSION_FIELDS);
|
||||
|
||||
// Checks that the given selected fields are present in all the used fields by the current filter
|
||||
if (!array_diff($selectedFields, $fields))
|
||||
{
|
||||
$this->setElementSession(self::SESSION_SELECTED_FIELDS, $selectedFields); // write changes into the session
|
||||
|
||||
$sortSelectedFields = true;
|
||||
}
|
||||
}
|
||||
|
||||
return $sortSelectedFields;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a selected field from the current filter
|
||||
*/
|
||||
public function removeSelectedField($selectedField)
|
||||
{
|
||||
$removeSelectedField = false;
|
||||
|
||||
// Checks the parameter selectedField
|
||||
if (isset($selectedField) && !empty(trim($selectedField)))
|
||||
{
|
||||
// Retrives all the used fields by the current filter
|
||||
$fields = $this->getElementSession(self::SESSION_FIELDS);
|
||||
// Retrives the selected fields by the current filter
|
||||
$selectedFields = $this->getElementSession(self::SESSION_SELECTED_FIELDS);
|
||||
|
||||
// Checks that the given selected field is present in the list of all the used fields by the current filter
|
||||
if (in_array($selectedField, $fields))
|
||||
{
|
||||
// If the selected field is present in the list of the selected fields by the current filter
|
||||
if (($pos = array_search($selectedField, $selectedFields)) !== false)
|
||||
{
|
||||
// Then remove it and shift the rest of elements by one if needed
|
||||
array_splice($selectedFields, $pos, 1);
|
||||
}
|
||||
|
||||
$this->setElementSession(self::SESSION_SELECTED_FIELDS, $selectedFields); // write changes into the session
|
||||
|
||||
$removeSelectedField = true;
|
||||
}
|
||||
}
|
||||
|
||||
return $removeSelectedField;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a field to the current filter
|
||||
*/
|
||||
public function addSelectedField($selectedField)
|
||||
{
|
||||
$removeSelectedField = false;
|
||||
|
||||
// Checks the parameter selectedField
|
||||
if (isset($selectedField) && !empty(trim($selectedField)))
|
||||
{
|
||||
// Retrives all the used fields by the current filter
|
||||
$fields = $this->getElementSession(self::SESSION_FIELDS);
|
||||
// Retrives the selected fields by the current filter
|
||||
$selectedFields = $this->getElementSession(self::SESSION_SELECTED_FIELDS);
|
||||
|
||||
// Checks that the given selected field is present in the list of all the used fields by the current filter
|
||||
if (in_array($selectedField, $fields))
|
||||
{
|
||||
array_push($selectedFields, $selectedField); // place the new filed at the end of the selected fields list
|
||||
|
||||
$this->setElementSession(self::SESSION_SELECTED_FIELDS, $selectedFields); // write changes into the session
|
||||
|
||||
$removeSelectedField = true;
|
||||
}
|
||||
}
|
||||
|
||||
return $removeSelectedField;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove an applied filter (SQL where condition) from the current filter
|
||||
*/
|
||||
public function removeAppliedFilter($appliedFilter)
|
||||
{
|
||||
$removeAppliedFilter = false;
|
||||
|
||||
// Checks the parameter appliedFilter
|
||||
if (isset($appliedFilter) && !empty(trim($appliedFilter)))
|
||||
{
|
||||
// Retrives all the used fields by the current filter
|
||||
$fields = $this->getElementSession(self::SESSION_FIELDS);
|
||||
// Retrives the applied filters by the current filter
|
||||
$filters = $this->getElementSession(self::SESSION_FILTERS);
|
||||
|
||||
// Checks that the given applied filter is present in the list of all the used fields by the current filter
|
||||
if (in_array($appliedFilter, $fields))
|
||||
{
|
||||
// Search in what position the given applied filter is
|
||||
$pos = $this->_searchFilterByName($filters, $appliedFilter);
|
||||
if ($pos !== false) // If found
|
||||
{
|
||||
array_splice($filters, $pos, 1); // Then remove it and shift the rest of elements by one if needed
|
||||
}
|
||||
|
||||
// Write changes into the session
|
||||
$this->setElementSession(self::SESSION_FILTERS, $filters);
|
||||
$this->setElementSession(self::SESSION_RELOAD_DATASET, true); // the dataset must be reloaded
|
||||
|
||||
$removeAppliedFilter = true;
|
||||
}
|
||||
}
|
||||
|
||||
return $removeAppliedFilter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Apply all the applied filters (SQL where conditions) to the current filter
|
||||
*/
|
||||
public function applyFilters($appliedFilters, $appliedFiltersOperations, $appliedFiltersConditions, $appliedFiltersOptions)
|
||||
{
|
||||
$applyFilters = false;
|
||||
|
||||
// Checks the required parameters: appliedFilters and appliedFiltersOperations
|
||||
if (isset($appliedFilters) && is_array($appliedFilters)
|
||||
&& isset($appliedFiltersOperations) && is_array($appliedFiltersOperations))
|
||||
{
|
||||
$fields = $this->getElementSession(self::SESSION_FIELDS); // Retrives all the used fields by the current filter
|
||||
|
||||
// Checks that the given applied filters are present in all the used fields by the current filter
|
||||
if (!array_diff($appliedFilters, $fields))
|
||||
{
|
||||
$filters = array(); // starts building the new applied filters list
|
||||
for ($i = 0; $i < count($appliedFilters); $i++) // loops through the given applied filters
|
||||
{
|
||||
$filterDefinition = new stdClass(); // new applied filter definition
|
||||
|
||||
// Sets the filter definition required properties
|
||||
$filterDefinition->name = $appliedFilters[$i];
|
||||
$filterDefinition->operation = $appliedFiltersOperations[$i];
|
||||
|
||||
// Sets the filter definition optional properties
|
||||
$filterDefinition->condition = null;
|
||||
if (isset($appliedFiltersConditions) && isset($appliedFiltersConditions[$i]))
|
||||
{
|
||||
$filterDefinition->condition = $appliedFiltersConditions[$i];
|
||||
}
|
||||
|
||||
$filterDefinition->option = null;
|
||||
if (isset($appliedFiltersOptions) && isset($appliedFiltersOptions[$i]))
|
||||
{
|
||||
$filterDefinition->option = $appliedFiltersOptions[$i];
|
||||
}
|
||||
|
||||
$filters[$i] = $filterDefinition; // adds the new definition to the list
|
||||
}
|
||||
|
||||
// Write changes into the session
|
||||
$this->setElementSession(self::SESSION_FILTERS, $filters);
|
||||
$this->setElementSession(self::SESSION_RELOAD_DATASET, true); // the dataset must be reloaded
|
||||
|
||||
$applyFilters = true;
|
||||
}
|
||||
}
|
||||
|
||||
return $applyFilters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a filter (SQL where clause) to be applied to the current filter
|
||||
*/
|
||||
public function addFilter($filter)
|
||||
{
|
||||
$addFilter = false;
|
||||
|
||||
// Checks the parameter filter
|
||||
if (isset($filter) && !empty(trim($filter)))
|
||||
{
|
||||
// Retrives all the used fields by the current filter
|
||||
$fields = $this->getElementSession(self::SESSION_FIELDS);
|
||||
// Retrives the applied filters by the current filter
|
||||
$filters = $this->getElementSession(self::SESSION_FILTERS);
|
||||
|
||||
// Checks that the given applied filter is present in the list of all the used fields by the current filter
|
||||
if (in_array($filter, $fields))
|
||||
{
|
||||
// Search in what position the given applied filter is
|
||||
$pos = $this->_searchFilterByName($filters, $filter);
|
||||
if ($pos === false) // If NOT found then add it
|
||||
{
|
||||
// New filter definition
|
||||
$filterDefinition = new stdClass();
|
||||
// Sets filter definition required properties
|
||||
$filterDefinition->name = $filter;
|
||||
// Sets filter definition optional properties
|
||||
$filterDefinition->operation = null;
|
||||
$filterDefinition->condition = null;
|
||||
$filterDefinition->option = null;
|
||||
// Place the new applied filter at the end of the applied filters list
|
||||
array_push($filters, $filterDefinition);
|
||||
}
|
||||
|
||||
$this->setElementSession(self::SESSION_FILTERS, $filters); // write changes into the session
|
||||
|
||||
$addFilter = true;
|
||||
}
|
||||
}
|
||||
|
||||
return $addFilter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Save the current filter as a custom filter for this user with the given description
|
||||
*/
|
||||
public function saveCustomFilter($customFilterDescription)
|
||||
{
|
||||
$saveCustomFilter = false; // by default returns a failure
|
||||
|
||||
// Checks parameter customFilterDescription if not valid stop the execution
|
||||
if (!isset($customFilterDescription) || empty(trim($customFilterDescription)))
|
||||
{
|
||||
return $saveCustomFilter;
|
||||
}
|
||||
|
||||
$this->_ci->load->model('system/Filters_model', 'FiltersModel'); // to load the filter definitions
|
||||
$this->_ci->load->model('person/Benutzer_model', 'BenutzerModel'); // to get the person_id of the authenticated user
|
||||
|
||||
$this->_ci->FiltersModel->resetQuery(); // reset any previous built query
|
||||
$this->_ci->BenutzerModel->resetQuery(); // reset any previous built query
|
||||
|
||||
// Loads data for the authenticated user
|
||||
$authBenutzer = $this->_ci->BenutzerModel->loadWhere(array('uid' => getAuthUID()));
|
||||
if (hasData($authBenutzer)) // if data are found
|
||||
{
|
||||
// person_id of the authenticated user
|
||||
$authPersonId = $authBenutzer->retval[0]->person_id;
|
||||
// Postgres array for the description
|
||||
$descPGArray = str_replace('%desc%', $customFilterDescription, '{"%desc%", "%desc%", "%desc%", "%desc%"}');
|
||||
|
||||
// Loads the definition to check if is already present in the DB
|
||||
$definition = $this->_ci->FiltersModel->loadWhere(array(
|
||||
'app' => $this->getElementSession(self::APP_PARAMETER),
|
||||
'dataset_name' => $this->getElementSession(self::DATASET_NAME_PARAMETER),
|
||||
'description' => $descPGArray,
|
||||
'person_id' => $authPersonId
|
||||
));
|
||||
|
||||
// New definition to be json encoded
|
||||
$jsonDeifinition = new stdClass();
|
||||
$jsonDeifinition->name = $customFilterDescription; // name of the filter
|
||||
|
||||
// Generates the "column" property
|
||||
$jsonDeifinition->columns = array();
|
||||
$selectedFields = $this->getElementSession(self::SESSION_SELECTED_FIELDS); // retrived the selected fields
|
||||
for ($i = 0; $i < count($selectedFields); $i++)
|
||||
{
|
||||
// Each element is an object with a property called "name"
|
||||
$jsonDeifinition->columns[$i] = new stdClass();
|
||||
$jsonDeifinition->columns[$i]->name = $selectedFields[$i];
|
||||
}
|
||||
|
||||
// List of applied filters
|
||||
$jsonDeifinition->filters = $this->getElementSession(self::SESSION_FILTERS);
|
||||
|
||||
// If it is already present
|
||||
if (hasData($definition))
|
||||
{
|
||||
// update it
|
||||
$this->_ci->FiltersModel->update(
|
||||
array(
|
||||
'app' => $this->getElementSession(self::APP_PARAMETER),
|
||||
'dataset_name' => $this->getElementSession(self::DATASET_NAME_PARAMETER),
|
||||
'description' => $descPGArray,
|
||||
'person_id' => $authPersonId
|
||||
),
|
||||
array(
|
||||
'filter' => json_encode($jsonDeifinition)
|
||||
)
|
||||
);
|
||||
|
||||
$saveCustomFilter = true;
|
||||
}
|
||||
else // otherwise insert a new one
|
||||
{
|
||||
$this->_ci->FiltersModel->insert(
|
||||
array(
|
||||
'app' => $this->getElementSession(self::APP_PARAMETER),
|
||||
'dataset_name' => $this->getElementSession(self::DATASET_NAME_PARAMETER),
|
||||
'filter_kurzbz' => uniqid($authPersonId, true),
|
||||
'description' => $descPGArray,
|
||||
'person_id' => $authPersonId,
|
||||
'sort' => null,
|
||||
'default_filter' => false,
|
||||
'filter' => json_encode($jsonDeifinition),
|
||||
'oe_kurzbz' => null
|
||||
)
|
||||
);
|
||||
|
||||
$saveCustomFilter = true;
|
||||
}
|
||||
}
|
||||
|
||||
return $saveCustomFilter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a custom filter by its filter_id
|
||||
*/
|
||||
public function removeCustomFilter($filterId)
|
||||
{
|
||||
$removeCustomFilter = false;
|
||||
|
||||
// Checks the parameter filterId
|
||||
if (isset($filterId) && is_numeric($filterId) && $filterId > 0)
|
||||
{
|
||||
$this->_ci->load->model('system/Filters_model', 'FiltersModel'); // to remove the filter definitions from DB
|
||||
|
||||
// delete it!
|
||||
$this->_ci->FiltersModel->delete(array('filter_id' => $filterId));
|
||||
|
||||
$removeCustomFilter = true;
|
||||
}
|
||||
|
||||
return $removeCustomFilter;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
/**
|
||||
* Return an unique string that identify this filter widget
|
||||
* NOTE: The default value is the URI where the FilterWidget is called
|
||||
* If the fhc_controller_id is present then is also used
|
||||
*/
|
||||
private function _getFilterUniqueId($params)
|
||||
{
|
||||
//
|
||||
if ($params != null
|
||||
&& is_array($params)
|
||||
&& isset($params[self::FILTER_PAGE_PARAM])
|
||||
&& !empty(trim($params[self::FILTER_PAGE_PARAM])))
|
||||
{
|
||||
$filterUniqueId = $params[self::FILTER_PAGE_PARAM];
|
||||
}
|
||||
else
|
||||
{
|
||||
// Gets the current page URI
|
||||
$filterUniqueId = $this->_ci->router->directory.$this->_ci->router->class.'/'.$this->_ci->router->method;
|
||||
}
|
||||
|
||||
// If the FHC_CONTROLLER_ID parameter is present in the HTTP GET
|
||||
if (isset($_GET[self::FHC_CONTROLLER_ID]))
|
||||
{
|
||||
$filterUniqueId .= '/'.$this->_ci->input->get(self::FHC_CONTROLLER_ID); // then use it
|
||||
}
|
||||
elseif (isset($_POST[self::FHC_CONTROLLER_ID])) // else if the FHC_CONTROLLER_ID parameter is present in the HTTP POST
|
||||
{
|
||||
$filterUniqueId .= '/'.$this->_ci->input->post(self::FHC_CONTROLLER_ID); // then use it
|
||||
}
|
||||
|
||||
return $filterUniqueId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates a condition for a SQL where clause using the given applied filter definition.
|
||||
* By default an empty string is returned.
|
||||
*/
|
||||
private function _getDatasetQueryCondition($filterDefinition)
|
||||
{
|
||||
$condition = ''; // starts building the condition
|
||||
|
||||
// "operation" is a required property for the applied filter definition
|
||||
if (!empty(trim($filterDefinition->operation)))
|
||||
{
|
||||
// Checks what operation is required
|
||||
switch ($filterDefinition->operation)
|
||||
{
|
||||
// comparison (==)
|
||||
case self::OP_EQUAL:
|
||||
if (is_numeric($filterDefinition->condition)) $condition = '= '.$filterDefinition->condition;
|
||||
break;
|
||||
// not equal (!=)
|
||||
case self::OP_NOT_EQUAL:
|
||||
if (is_numeric($filterDefinition->condition)) $condition = '!= '.$filterDefinition->condition;
|
||||
break;
|
||||
// greater than (>)
|
||||
case self::OP_GREATER_THAN:
|
||||
// It it's a date type
|
||||
if (is_numeric($filterDefinition->condition)
|
||||
&& isset($filterDefinition->option)
|
||||
&& ($filterDefinition->option == self::OPT_DAYS
|
||||
|| $filterDefinition->option == self::OPT_MONTHS))
|
||||
{
|
||||
$condition = '< (NOW() - \''.$filterDefinition->condition.' '.$filterDefinition->option.'\'::interval)';
|
||||
}
|
||||
else // otherwise is a number
|
||||
{
|
||||
$condition = '> '.$filterDefinition->condition;
|
||||
}
|
||||
break;
|
||||
// less than (<)
|
||||
case self::OP_LESS_THAN:
|
||||
// It it's a date type
|
||||
if (is_numeric($filterDefinition->condition)
|
||||
&& isset($filterDefinition->option)
|
||||
&& ($filterDefinition->option == self::OPT_DAYS
|
||||
|| $filterDefinition->option == self::OPT_MONTHS))
|
||||
{
|
||||
$condition = '> (NOW() - \''.$filterDefinition->condition.' '.$filterDefinition->option.'\'::interval)';
|
||||
}
|
||||
else // otherwise is a number
|
||||
{
|
||||
$condition = '< '.$filterDefinition->condition;
|
||||
}
|
||||
break;
|
||||
// contains (ILIKE)
|
||||
case self::OP_CONTAINS:
|
||||
$condition = 'ILIKE \'%'.$this->_ci->FiltersModel->escapeLike($filterDefinition->condition).'%\'';
|
||||
break;
|
||||
// not contains (NOT ILIKE)
|
||||
case self::OP_NOT_CONTAINS:
|
||||
$condition = 'NOT ILIKE \'%'.$this->_ci->FiltersModel->escapeLike($filterDefinition->condition).'%\'';
|
||||
break;
|
||||
// is true (=== true)
|
||||
case self::OP_IS_TRUE:
|
||||
$condition = 'IS TRUE';
|
||||
break;
|
||||
// is false (=== false)
|
||||
case self::OP_IS_FALSE:
|
||||
$condition = 'IS FALSE';
|
||||
break;
|
||||
// is set
|
||||
case self::OP_SET:
|
||||
$condition = 'IS NOT NULL';
|
||||
break;
|
||||
// is NOT set
|
||||
case self::OP_NOT_SET:
|
||||
$condition = 'IS NULL';
|
||||
break;
|
||||
// by default must not be null (!= null)
|
||||
default:
|
||||
$condition = 'IS NOT NULL';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// if the condition is valid
|
||||
if (!empty(trim($condition))) $condition = ' '.$condition; // add a white space before
|
||||
|
||||
return $condition;
|
||||
}
|
||||
|
||||
/**
|
||||
* Search for a filter inside a list of filters by the given filter name
|
||||
* Returns false if NOT found, otherwise the position inside the list
|
||||
*/
|
||||
private function _searchFilterByName($filters, $filterName)
|
||||
{
|
||||
$pos = false;
|
||||
|
||||
for($i = 0; $i < count($filters); $i++)
|
||||
{
|
||||
if ($filters[$i]->name == $filterName)
|
||||
{
|
||||
$pos = $i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return $pos;
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,8 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
*/
|
||||
class PersonLogLib
|
||||
{
|
||||
const PARKED_LOGNAME = 'Parked';
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
@@ -79,4 +81,90 @@ class PersonLogLib
|
||||
else
|
||||
show_error($result->retval);
|
||||
}
|
||||
|
||||
/**
|
||||
* Parks a person, i.e. marks a person so no actions are expected for the person (e.g. as a prestudent)
|
||||
* Done by adding a logentry in the future
|
||||
* @param $person_id
|
||||
* @param $date
|
||||
* @param $taetigkeit_kurzbz
|
||||
* @param string $app
|
||||
* @param null $oe_kurzbz
|
||||
* @param null $user
|
||||
* @return insert object
|
||||
*/
|
||||
public function park($person_id, $date, $taetigkeit_kurzbz, $app = 'core', $oe_kurzbz = null, $user = null)
|
||||
{
|
||||
$logdata = array(
|
||||
'name' => self::PARKED_LOGNAME
|
||||
);
|
||||
|
||||
$data = array(
|
||||
'person_id' => $person_id,
|
||||
'zeitpunkt' => $date,
|
||||
'taetigkeit_kurzbz' => $taetigkeit_kurzbz,
|
||||
'app' => $app,
|
||||
'oe_kurzbz' => $oe_kurzbz,
|
||||
'logtype_kurzbz' => 'Processstate',
|
||||
'logdata' => json_encode($logdata),
|
||||
'insertvon' => $user
|
||||
);
|
||||
|
||||
return $this->ci->PersonLogModel->insert($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Unparks a person, i.e. removes all log entries in the future
|
||||
* @param $person_id
|
||||
* @return array with deleted logids
|
||||
*/
|
||||
public function unPark($person_id)
|
||||
{
|
||||
$result = $this->ci->PersonLogModel->getLogsInFuture($person_id);
|
||||
|
||||
$deleted = array();
|
||||
|
||||
if (hasData($result))
|
||||
{
|
||||
foreach ($result->retval as $log)
|
||||
{
|
||||
$logdata = json_decode($log->logdata);
|
||||
if (isset($logdata->name) && $logdata->name === self::PARKED_LOGNAME)
|
||||
{
|
||||
$delresult = $this->ci->PersonLogModel->deleteLog($log->log_id);
|
||||
if (isSuccess($delresult))
|
||||
$deleted[] = $log->log_id;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $deleted;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets date until which a person is parked
|
||||
* @param $person_id
|
||||
* @return the date if person is parked, null otherwise
|
||||
*/
|
||||
public function getParkedDate($person_id)
|
||||
{
|
||||
$result = $this->ci->PersonLogModel->getLogsInFuture($person_id);
|
||||
|
||||
$parkeddate = null;
|
||||
|
||||
if (hasData($result))
|
||||
{
|
||||
foreach ($result->retval as $log)
|
||||
{
|
||||
$logdata = json_decode($log->logdata);
|
||||
if (isset($logdata->name) && $logdata->name === self::PARKED_LOGNAME)
|
||||
{
|
||||
$parkeddate = $log->zeitpunkt;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $parkeddate;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,8 @@ class PhrasesLib
|
||||
{
|
||||
$this->_ci =& get_instance();
|
||||
|
||||
$this->_phrases = null; // set the property _phrases as null by default
|
||||
|
||||
// CI parser
|
||||
$this->_ci->load->library('parser');
|
||||
|
||||
@@ -78,7 +80,6 @@ class PhrasesLib
|
||||
return $this->_ci->PhraseModel->update($phrase_id, $data);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* getVorlagetextByVorlage() - will load tbl_vorlagestudiengang for a spezific Template.
|
||||
*/
|
||||
@@ -179,28 +180,39 @@ class PhrasesLib
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Retrives a phrases from the the property _phrases with the given parameters
|
||||
* It also replace parameters inside the phrase if they are provided
|
||||
* @param string $category Category name which is used to categorize the phrase.
|
||||
* @param string $phrase Phrase name.
|
||||
* @param array $parameters Array of String var(s) to be set into phrases' placeholder values (order matters).
|
||||
* @return string Phrase text
|
||||
*/
|
||||
public function t($category, $phrase, $parameters = array(), $orgeinheit_kurzbz = null, $orgform_kurzbz = null)
|
||||
{
|
||||
if (isset($this->_phrases) && is_array($this->_phrases))
|
||||
// If the property _phrases is populated
|
||||
if (is_array($this->_phrases))
|
||||
{
|
||||
// Loops through the _phrases property
|
||||
for ($i = 0; $i < count($this->_phrases); $i++)
|
||||
{
|
||||
$_phrase = $this->_phrases[$i];
|
||||
$_phrase = $this->_phrases[$i]; // single phrase
|
||||
|
||||
// If the single phrase match the given parameters and is not an empty string
|
||||
if ($_phrase->category == $category
|
||||
&& $_phrase->phrase == $phrase
|
||||
&& $_phrase->orgeinheit_kurzbz == $orgeinheit_kurzbz
|
||||
&& $_phrase->orgform_kurzbz== $orgform_kurzbz)
|
||||
&& $_phrase->orgform_kurzbz == $orgform_kurzbz
|
||||
&& (!empty(trim($_phrase->text))))
|
||||
{
|
||||
if ($parameters == null) $parameters = array();
|
||||
if (!is_array($parameters)) $parameters = array(); // if params is not an array
|
||||
|
||||
echo $this->_ci->parser->parse_string($_phrase->text, $parameters, true)."\n";
|
||||
break;
|
||||
return $this->_ci->parser->parse_string($_phrase->text, $parameters, true); // parsing
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If a valid phrase is not found
|
||||
return '<< PHRASE '.$phrase.' >>';
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
@@ -209,16 +221,19 @@ class PhrasesLib
|
||||
/**
|
||||
* Extends the functionalities of the constructor of this class
|
||||
* This is a workaround to use more parameters in the construct since PHP doesn't support many constructors
|
||||
* The new accepted parameters are:
|
||||
* - categories: could be a string or an array of strings. These are the categories used to load phrases
|
||||
* - language: optional parameter must be a string. It's used to load phrases
|
||||
* @param (array) $params Array of categories and (optional) language.
|
||||
* categories:
|
||||
* - could be a string or an array of strings. These are the categories used to load phrases
|
||||
* - could be an array of categories, and for each category there is an array of phrases
|
||||
* language: optional parameter must be a string. It's used to load phrases
|
||||
*/
|
||||
private function _extend_construct($params)
|
||||
{
|
||||
// Checks if the $params is an array with at least one element
|
||||
if (is_array($params) && count($params) > 0)
|
||||
{
|
||||
$parameters = $params[0]; // temporary variable
|
||||
$parameters = $params[0]; // temporary variable
|
||||
$isIndexArray = false; //flag for indexed array
|
||||
|
||||
// If there are parameters
|
||||
if (is_array($parameters) && count($parameters) > 0)
|
||||
@@ -242,15 +257,101 @@ class PhrasesLib
|
||||
$language = $this->_ci->PersonModel->getLanguage(getAuthUID());
|
||||
}
|
||||
|
||||
// Loads phrases
|
||||
$phrases = $this->_ci->PhraseModel->getPhrasesByCategoryAndLanguage($categories, $language);
|
||||
|
||||
// If there are phrases loaded then store them in the property _phrases
|
||||
if (hasData($phrases))
|
||||
{
|
||||
$this->_phrases = $phrases->retval;
|
||||
}
|
||||
// If only categories is not an empty array then loads phrases
|
||||
if (count($categories) > 0) $this->_setPhrases($categories, $language);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves phrases in the users language.
|
||||
* If a phrase is not set in the users language it will be retrieved in the default language.
|
||||
* Stores phrases-array in property $_phrases.
|
||||
* @param array $categories Could be an:
|
||||
* - indexed array: string or an array of strings. These are the categories used to load phrases.
|
||||
* - associative array: of categories, and for each category there is an array of phrases.
|
||||
* @param string User's language or default language.
|
||||
*/
|
||||
private function _setPhrases($categories, $language)
|
||||
{
|
||||
$phrases = null;
|
||||
// Checks if categories is associative or indexed array
|
||||
if (ctype_digit(implode('', array_keys($categories))))
|
||||
{
|
||||
// is indexed array -> Loads phrases
|
||||
$isIndexArray = true;
|
||||
$phrases = $this->_ci->PhraseModel->getPhrasesByCategoryAndLanguage($categories, $language);
|
||||
}
|
||||
else
|
||||
{
|
||||
// is assoc array -> Loads specific phrasentexte by category and phrases
|
||||
$isIndexArray = false;
|
||||
$phrases = $this->_ci->PhraseModel->getPhrasesByCategoryAndPhrasesAndLanguage($categories, $language);
|
||||
}
|
||||
|
||||
// If language is not default language and phrasentext is null -> fallback to default language
|
||||
if ($language != DEFAULT_LANGUAGE)
|
||||
{
|
||||
// get array with phrasentexte in the default language
|
||||
$defaultPhrases = null;
|
||||
if ($isIndexArray)
|
||||
{
|
||||
$defaultPhrases = $this->_ci->PhraseModel->getPhrasesByCategoryAndLanguage($categories, DEFAULT_LANGUAGE);
|
||||
}
|
||||
else
|
||||
{
|
||||
$defaultPhrases = $this->_ci->PhraseModel->getPhrasesByCategoryAndPhrasesAndLanguage($categories, DEFAULT_LANGUAGE);
|
||||
}
|
||||
|
||||
// combine array with phrasentexte in users language and in default language
|
||||
// (default used if phrasentext in users language is null or not set)
|
||||
if (hasData($phrases) && hasData($defaultPhrases))
|
||||
{
|
||||
// loop through phrases in default language
|
||||
foreach ($defaultPhrases->retval as $defaultPhrase)
|
||||
{
|
||||
$found = false; // flag for found phrase
|
||||
|
||||
// loop through phrases in users language
|
||||
foreach ($phrases->retval as $phrase)
|
||||
{
|
||||
// if same phrase and category found and text is not null
|
||||
// use phrase in users language
|
||||
if ($phrase->phrase == $defaultPhrase->phrase
|
||||
&& $phrase->category == $defaultPhrase->category
|
||||
&& !is_null($phrase->text))
|
||||
{
|
||||
$found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// otherwise use phrase in default language
|
||||
if (!$found)
|
||||
{
|
||||
array_push($phrases->retval, $defaultPhrase);
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif (hasData($defaultPhrases))
|
||||
{
|
||||
$phrases = $defaultPhrases;
|
||||
}
|
||||
}
|
||||
|
||||
// If there are phrases loaded then store them in the property _phrases
|
||||
if (hasData($phrases))
|
||||
{
|
||||
$this->_phrases = $phrases->retval;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the property _phrases JSON encoded
|
||||
* @return json encoded property _phrases
|
||||
*/
|
||||
public function getJSON()
|
||||
{
|
||||
return json_encode($this->_phrases);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,9 @@ class Geschaeftsjahr_model extends DB_Model
|
||||
$query = 'SELECT *
|
||||
FROM public.tbl_geschaeftsjahr
|
||||
WHERE start <= now()
|
||||
AND ende >= now()';
|
||||
AND ende >= now()
|
||||
ORDER BY start DESC
|
||||
LIMIT 1';
|
||||
|
||||
return $this->execQuery($query);
|
||||
}
|
||||
|
||||
@@ -12,4 +12,21 @@ class Studienjahr_model extends DB_Model
|
||||
$this->pk = 'studienjahr_kurzbz';
|
||||
$this->hasSequence = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets current Studienjahr, as determined by its start and enddate
|
||||
* @return array|null
|
||||
*/
|
||||
public function getCurrStudienjahr()
|
||||
{
|
||||
$query = 'SELECT *
|
||||
FROM public.tbl_studienjahr
|
||||
JOIN public.tbl_studiensemester using(studienjahr_kurzbz)
|
||||
WHERE start <= now()
|
||||
AND ende >= now()
|
||||
ORDER by start DESC
|
||||
LIMIT 1';
|
||||
|
||||
return $this->execQuery($query);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +44,6 @@ class Filters_model extends DB_Model
|
||||
$filterParametersArray = array(
|
||||
'app' => $app,
|
||||
'dataset_name' => $dataset_name,
|
||||
'default_filter' => false,
|
||||
'array_length(description, 1) >' => 0,
|
||||
'uid' => $uid
|
||||
);
|
||||
|
||||
@@ -80,4 +80,36 @@ class PersonLog_model extends CI_Model
|
||||
|
||||
return success($result->result());
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets all logs with zeitpunkt > today
|
||||
* @param $person_id
|
||||
* @return array
|
||||
*/
|
||||
public function getLogsInFuture($person_id)
|
||||
{
|
||||
$this->db->order_by('zeitpunkt', 'DESC');
|
||||
$this->db->order_by('log_id', 'DESC');
|
||||
|
||||
$where = "logtype_kurzbz = 'Processstate'
|
||||
AND person_id=".$this->db->escape($person_id)."
|
||||
AND zeitpunkt >= now()";
|
||||
|
||||
$result = $this->db->get_where($this->dbTable, $where);
|
||||
|
||||
return success($result->result());
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a log
|
||||
* @param $log_id
|
||||
* @return array
|
||||
*/
|
||||
public function deleteLog($log_id)
|
||||
{
|
||||
$this->db->where('log_id', $log_id);
|
||||
$result = $this->db->delete($this->dbTable);
|
||||
|
||||
return success($result);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,4 +71,32 @@ class Phrase_model extends DB_Model
|
||||
|
||||
return $this->execQuery($query, array($categories, $language));
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads phrases using category(s) and language as keys using associative category array
|
||||
* that contains also phrases for each category
|
||||
*/
|
||||
public function getPhrasesByCategoryAndPhrasesAndLanguage($phrasesParams, $language)
|
||||
{
|
||||
$query = '
|
||||
SELECT p.category, p.phrase, pt.orgeinheit_kurzbz, pt.orgform_kurzbz, pt.text
|
||||
FROM system.tbl_phrase p
|
||||
INNER JOIN system.tbl_phrasentext pt USING(phrase_id)
|
||||
WHERE pt.sprache = ? AND ';
|
||||
|
||||
$parametersArray = array($language);
|
||||
|
||||
foreach ($phrasesParams as $category => $phrases)
|
||||
{
|
||||
$query .= '(category = ? AND phrase IN ?) OR ';
|
||||
$parametersArray[] = $category;
|
||||
$parametersArray[] = $phrases;
|
||||
}
|
||||
|
||||
$query = rtrim($query, ' OR ');
|
||||
|
||||
$query .= ' ORDER BY p.category, p.phrase, pt.orgeinheit_kurzbz DESC, pt.orgform_kurzbz DESC';
|
||||
|
||||
return $this->execQuery($query, $parametersArray);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,9 @@ $this->load->view('templates/FHC-Header',
|
||||
'jquery' => true,
|
||||
'bootstrap' => true,
|
||||
'fontawesome' => true,
|
||||
'sbadmintemplate' => true
|
||||
'sbadmintemplate' => true,
|
||||
'ajaxlib' => true,
|
||||
'navigationwidget' => true
|
||||
)
|
||||
);
|
||||
?>
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
<input type="hidden" name="hiddenNotizId" value="">
|
||||
<div class="form-group">
|
||||
<div class="text-center">
|
||||
<label>Notiz hinzufügen</label>
|
||||
<label><?php echo $this->p->t('infocenter', 'notizHinzufuegen') ?></label>
|
||||
</div>
|
||||
<div>
|
||||
<div class="form-group">
|
||||
<label>Titel: </label>
|
||||
<label><?php echo ucfirst($this->p->t('global', 'titel')) . ': ' ?></label>
|
||||
<div class="input-group">
|
||||
<input id="inputNotizTitel" type="text" class="form-control" name="notiztitel"/>
|
||||
<div class="input-group-addon" onclick="document.getElementById('inputNotizTitel').value='Anmerkung zur Bewerbung'">
|
||||
@@ -21,8 +21,9 @@
|
||||
</div>
|
||||
<div class="text-right">
|
||||
<!--abbrechen-button only shown when notice is clicked to be changed-->
|
||||
<button type="reset" class="btn btn-default" style="display: none">Abbrechen</button>
|
||||
<button type="submit" class="btn btn-default">Speichern</button>
|
||||
<span class="text-danger" id="notizmsg"></span>
|
||||
<button type="reset" class="btn btn-default" style="display: none"><?php echo $this->p->t('ui', 'abbrechen') ?></button>
|
||||
<button type="submit" class="btn btn-default"><?php echo $this->p->t('ui', 'speichern') ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</form>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<table class="table-bordered" align="center" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="2" class="text-center">Anmerkungen zur Bewerbung</th>
|
||||
<th colspan="2" class="text-center"><?php echo ucfirst($this->p->t('infocenter','anmerkungenZurBewerbung')) ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
<table id="doctable" class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Typ</th>
|
||||
<th>Uploaddatum</th>
|
||||
<th>Ausstellungsnation</th>
|
||||
<th>Formal geprüft</th>
|
||||
<th><?php echo ucfirst($this->p->t('global','name')) ?></th>
|
||||
<th><?php echo ucfirst($this->p->t('global','typ')) ?></th>
|
||||
<th><?php echo ucfirst($this->p->t('global','uploaddatum')) ?></th>
|
||||
<th><?php echo ucfirst($this->p->t('infocenter','ausstellungsnation')) ?></th>
|
||||
<th><?php echo ucfirst($this->p->t('infocenter','formalGeprueft')) ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -35,14 +35,14 @@
|
||||
</div>
|
||||
<?php if (count($dokumente_nachgereicht) > 0): ?>
|
||||
<br/>
|
||||
<p>Nachzureichende Dokumente:</p>
|
||||
<p><?php echo ucfirst($this->p->t('infocenter','nachzureichendeDokumente')) ?></p>
|
||||
<table id="nachgdoctable" class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Typ</th>
|
||||
<th>Nachzureichen am</th>
|
||||
<th>Ausstellungsnation</th>
|
||||
<th>Anmerkung</th>
|
||||
<th><?php echo ucfirst($this->p->t('global','typ')) ?></th>
|
||||
<th><?php echo ucfirst($this->p->t('infocenter','nachzureichenAm')) ?></th>
|
||||
<th><?php echo ucfirst($this->p->t('infocenter','ausstellungsnation')) ?></th>
|
||||
<th><?php echo ucfirst($this->p->t('global','anmerkung')) ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
@@ -5,10 +5,18 @@
|
||||
'title' => 'Info Center',
|
||||
'jquery' => true,
|
||||
'jqueryui' => true,
|
||||
'ajaxlib' => true,
|
||||
'bootstrap' => true,
|
||||
'fontawesome' => true,
|
||||
'sbadmintemplate' => true,
|
||||
'tablesorter' => true,
|
||||
'filterwidget' => true,
|
||||
'phrases' => array(
|
||||
'person' => array('vorname', 'nachname'),
|
||||
'global' => array('mailAnXversandt'),
|
||||
'ui' => array('bitteEintragWaehlen')
|
||||
),
|
||||
'navigationwidget' => true,
|
||||
'customCSSs' => 'public/css/sbadmin2/tablesort_bootstrap.css',
|
||||
'customJSs' => array('public/js/bootstrapper.js', 'public/js/infocenter/infocenterPersonDataset.js')
|
||||
)
|
||||
@@ -24,12 +32,17 @@
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<h3 class="page-header">Infocenter Übersicht</h3>
|
||||
<h3 class="page-header">Infocenter
|
||||
<?php echo ucfirst($this->p->t('global', 'uebersicht')); ?>
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<?php
|
||||
$this->load->view('system/infocenter/infocenterData.php', array('fhc_controller_id' => $fhc_controller_id));
|
||||
$this->load->view(
|
||||
'system/infocenter/infocenterData.php',
|
||||
array('fhc_controller_id' => $fhc_controller_id)
|
||||
);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
FROM public.tbl_studiensemester
|
||||
WHERE ende >= NOW()
|
||||
)
|
||||
AND not exists (select 1 from tbl_prestudentstatus psss where psss.prestudent_id = pss.prestudent_id and psss.status_kurzbz = \'Abgewiesener\')
|
||||
AND not exists (select 1 from tbl_prestudentstatus psss where psss.prestudent_id = pss.prestudent_id and psss.status_kurzbz = \'Abgewiesener\' and psss.studiensemester_kurzbz = \'WS2018\')
|
||||
LIMIT 1
|
||||
) AS "AnzahlAbgeschickt",
|
||||
array_to_string(
|
||||
@@ -103,7 +103,7 @@
|
||||
FROM public.tbl_studiensemester
|
||||
WHERE ende >= NOW()
|
||||
)
|
||||
AND not exists (select 1 from tbl_prestudentstatus psss where psss.prestudent_id = pss.prestudent_id and psss.status_kurzbz = \'Abgewiesener\')
|
||||
AND not exists (select 1 from tbl_prestudentstatus psss where psss.prestudent_id = pss.prestudent_id and psss.status_kurzbz = \'Abgewiesener\' and psss.studiensemester_kurzbz = \'WS2018\')
|
||||
LIMIT 1
|
||||
),\', \'
|
||||
) AS "StgAbgeschickt",
|
||||
@@ -125,7 +125,7 @@
|
||||
FROM public.tbl_studiensemester
|
||||
WHERE ende >= NOW()
|
||||
)
|
||||
AND not exists (select 1 from tbl_prestudentstatus psss where psss.prestudent_id = pss.prestudent_id and psss.status_kurzbz = \'Abgewiesener\')
|
||||
AND not exists (select 1 from tbl_prestudentstatus psss where psss.prestudent_id = pss.prestudent_id and psss.status_kurzbz = \'Abgewiesener\' and psss.studiensemester_kurzbz = \'WS2018\')
|
||||
LIMIT 1
|
||||
),\', \'
|
||||
) AS "StgNichtAbgeschickt",
|
||||
@@ -146,14 +146,22 @@
|
||||
FROM public.tbl_studiensemester
|
||||
WHERE start >= NOW()
|
||||
)
|
||||
AND not exists (select 1 from tbl_prestudentstatus psss where psss.prestudent_id = pss.prestudent_id and psss.status_kurzbz = \'Abgewiesener\')
|
||||
AND not exists (select 1 from tbl_prestudentstatus psss where psss.prestudent_id = pss.prestudent_id and psss.status_kurzbz = \'Abgewiesener\' and psss.studiensemester_kurzbz = \'WS2018\')
|
||||
LIMIT 1
|
||||
),\', \'
|
||||
) AS "StgAktiv",
|
||||
pl.zeitpunkt AS "LockDate",
|
||||
pl.lockuser as "LockUser"
|
||||
pl.lockuser AS "LockUser",
|
||||
pd.parkdate AS "ParkDate"
|
||||
FROM public.tbl_person p
|
||||
LEFT JOIN (SELECT person_id, zeitpunkt, uid as lockuser FROM system.tbl_person_lock WHERE app = \''.$APP.'\') pl USING(person_id)
|
||||
LEFT JOIN (
|
||||
SELECT person_id, zeitpunkt as parkdate
|
||||
FROM system.tbl_log
|
||||
WHERE logtype_kurzbz = \'Processstate\'
|
||||
AND logdata->>\'name\' = \'Parked\'
|
||||
AND zeitpunkt >= now()
|
||||
) pd USING(person_id)
|
||||
WHERE
|
||||
EXISTS(
|
||||
SELECT 1
|
||||
@@ -187,22 +195,33 @@
|
||||
ORDER BY "LastAction" ASC
|
||||
',
|
||||
'requiredPermissions' => 'infocenter',
|
||||
'fhc_controller_id' => $fhc_controller_id,
|
||||
'checkboxes' => 'PersonId',
|
||||
'additionalColumns' => array('Details'),
|
||||
'columnsAliases' => array(
|
||||
'PersonID', 'Vorname', 'Nachname',
|
||||
'GebDatum', 'Nation', 'Letzte Aktion',
|
||||
'Letzter Bearbeiter', 'StSem', 'GesendetAm',
|
||||
'NumAbgeschickt', 'StgSent', 'StgNotSent',
|
||||
'StgAktiv', 'Sperrdatum', 'GesperrtVon'
|
||||
'PersonID',
|
||||
ucfirst($this->p->t('person', 'vorname')) ,
|
||||
ucfirst($this->p->t('person', 'nachname')),
|
||||
ucfirst($this->p->t('person', 'geburtsdatum')),
|
||||
ucfirst($this->p->t('person', 'nation')),
|
||||
ucfirst($this->p->t('global', 'letzteAktion')),
|
||||
ucfirst($this->p->t('global', 'letzterBearbeiter')),
|
||||
ucfirst($this->p->t('lehre', 'studiensemester')),
|
||||
ucfirst($this->p->t('global', 'gesendetAm')),
|
||||
ucfirst($this->p->t('global', 'abgeschickt')).' ('.$this->p->t('global', 'anzahl').')',
|
||||
ucfirst($this->p->t('lehre', 'studiengang')).' ('.$this->p->t('global', 'gesendet').')',
|
||||
ucfirst($this->p->t('lehre', 'studiengang')).' ('.$this->p->t('global', 'nichtGesendet').')',
|
||||
ucfirst($this->p->t('lehre', 'studiengang')).' ('.$this->p->t('global', 'aktiv').')',
|
||||
ucfirst($this->p->t('global', 'sperrdatum')),
|
||||
ucfirst($this->p->t('global', 'gesperrtVon')),
|
||||
ucfirst($this->p->t('global', 'parkdatum'))
|
||||
),
|
||||
'formatRaw' => function($datasetRaw) {
|
||||
'formatRow' => function($datasetRaw) {
|
||||
|
||||
$datasetRaw->{'Details'} = sprintf(
|
||||
'<a href="%s%s">Details</a>',
|
||||
site_url('system/infocenter/InfoCenter/showDetails/'),
|
||||
$datasetRaw->{'PersonId'}
|
||||
'<a href="%s/%s?fhc_controller_id=%s">Details</a>',
|
||||
site_url('system/infocenter/InfoCenter/showDetails'),
|
||||
$datasetRaw->{'PersonId'},
|
||||
(isset($_GET['fhc_controller_id'])?$_GET['fhc_controller_id']:'')
|
||||
);
|
||||
|
||||
if ($datasetRaw->{'SendDate'} == null)
|
||||
@@ -211,7 +230,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
$datasetRaw->{'SendDate'} = date_format(date_create($datasetRaw->{'SendDate'}),'Y-m-d H:i');
|
||||
$datasetRaw->{'SendDate'} = date_format(date_create($datasetRaw->{'SendDate'}), 'Y-m-d H:i');
|
||||
}
|
||||
|
||||
if ($datasetRaw->{'LastAction'} == null)
|
||||
@@ -220,7 +239,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
$datasetRaw->{'LastAction'} = date_format(date_create($datasetRaw->{'LastAction'}),'Y-m-d H:i');
|
||||
$datasetRaw->{'LastAction'} = date_format(date_create($datasetRaw->{'LastAction'}), 'Y-m-d H:i');
|
||||
}
|
||||
|
||||
if ($datasetRaw->{'User/Operator'} == '')
|
||||
@@ -238,6 +257,11 @@
|
||||
$datasetRaw->{'LockUser'} = '-';
|
||||
}
|
||||
|
||||
if ($datasetRaw->{'ParkDate'} == null)
|
||||
{
|
||||
$datasetRaw->{'ParkDate'} = '-';
|
||||
}
|
||||
|
||||
if ($datasetRaw->{'StgAbgeschickt'} == null)
|
||||
{
|
||||
$datasetRaw->{'StgAbgeschickt'} = '-';
|
||||
@@ -259,25 +283,26 @@
|
||||
},
|
||||
'markRow' => function($datasetRaw) {
|
||||
|
||||
$mark = '';
|
||||
|
||||
if ($datasetRaw->LockDate != null)
|
||||
{
|
||||
return FilterWidget::DEFAULT_MARK_ROW_CLASS;
|
||||
$mark = FilterWidget::DEFAULT_MARK_ROW_CLASS;
|
||||
}
|
||||
|
||||
if ($datasetRaw->ParkDate != null)
|
||||
{
|
||||
// Parking has priority over locking
|
||||
$mark = "text-info";
|
||||
}
|
||||
|
||||
return $mark;
|
||||
}
|
||||
);
|
||||
|
||||
$filterId = isset($_GET[InfoCenter::FILTER_ID]) ? $_GET[InfoCenter::FILTER_ID] : null;
|
||||
|
||||
if (isset($filterId) && is_numeric($filterId))
|
||||
{
|
||||
$filterWidgetArray[InfoCenter::FILTER_ID] = $filterId;
|
||||
}
|
||||
else
|
||||
{
|
||||
$filterWidgetArray['app'] = $APP;
|
||||
$filterWidgetArray['datasetName'] = 'PersonActions';
|
||||
$filterWidgetArray['filterKurzbz'] = 'InfoCenterNotSentApplicationAll';
|
||||
}
|
||||
$filterWidgetArray[InfoCenter::FILTER_ID] = $this->input->get(InfoCenter::FILTER_ID);
|
||||
$filterWidgetArray['app'] = $APP;
|
||||
$filterWidgetArray['datasetName'] = 'PersonActions';
|
||||
|
||||
echo $this->widgetlib->widget('FilterWidget', $filterWidgetArray);
|
||||
?>
|
||||
|
||||
@@ -7,10 +7,12 @@
|
||||
'bootstrap' => true,
|
||||
'fontawesome' => true,
|
||||
'jqueryui' => true,
|
||||
'ajaxlib' => true,
|
||||
'tablesorter' => true,
|
||||
'tinymce' => true,
|
||||
'sbadmintemplate' => true,
|
||||
'addons' => true,
|
||||
'navigationwidget' => true,
|
||||
'customCSSs' =>
|
||||
array(
|
||||
'public/css/sbadmin2/admintemplate.css',
|
||||
@@ -20,8 +22,33 @@
|
||||
array(
|
||||
'public/js/bootstrapper.js',
|
||||
'public/js/tablesort/tablesort.js',
|
||||
'public/js/infocenter/infocenterDetails.js')
|
||||
'public/js/infocenter/infocenterDetails.js'
|
||||
),
|
||||
'phrases' =>
|
||||
array(
|
||||
'infocenter' =>
|
||||
array(
|
||||
'notizHinzufuegen',
|
||||
'notizAendern',
|
||||
'bewerberParken',
|
||||
'bewerberAusparken',
|
||||
'nichtsZumAusparken',
|
||||
'fehlerBeimAusparken',
|
||||
'fehlerBeimParken',
|
||||
'bewerberGeparktBis'
|
||||
),
|
||||
'ui' =>
|
||||
array(
|
||||
'gespeichert',
|
||||
'fehlerBeimSpeichern'
|
||||
),
|
||||
'global' =>
|
||||
array(
|
||||
'bis',
|
||||
'zeilen'
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
?>
|
||||
<body>
|
||||
@@ -40,14 +67,16 @@
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<div class="headerright text-right">
|
||||
wird bearbeitet von:
|
||||
<?php
|
||||
if (isset($lockedby)):
|
||||
echo $this->p->t('global', 'wirdBearbeitetVon') . ': ';
|
||||
echo $lockedby;
|
||||
?>
|
||||
|
||||
<a href="../unlockPerson/<?php echo $stammdaten->person_id; ?>"><i
|
||||
class="fa fa-sign-out"></i> Freigeben</a>
|
||||
if (!isset($show_lock_link) || $show_lock_link === true): ?>
|
||||
|
||||
<a href="../unlockPerson/<?php echo $stammdaten->person_id; ?>?fhc_controller_id=<?php echo $fhc_controller_id; ?>">
|
||||
<i class="fa fa-sign-out"></i> <?php echo ucfirst($this->p->t('ui', 'freigeben')) ?>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -57,7 +86,9 @@
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading text-center"><h4>Stammdaten</h4></div>
|
||||
<div class="panel-heading text-center">
|
||||
<h4><?php echo ucfirst($this->p->t('global', 'stammdaten')) ?></h4>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<?php $this->load->view('system/infocenter/stammdaten.php'); ?>
|
||||
<?php $this->load->view('system/infocenter/anmerkungenZurBewerbung.php'); ?>
|
||||
@@ -71,7 +102,9 @@
|
||||
<div class="col-lg-12">
|
||||
<div class="panel panel-primary">
|
||||
<a name="DokPruef"></a><!-- anchor for jumping to the section -->
|
||||
<div class="panel-heading text-center"><h4>Dokumentenprüfung</h4></div>
|
||||
<div class="panel-heading text-center">
|
||||
<h4><?php echo ucfirst($this->p->t('infocenter', 'dokumentenpruefung')) ?></h4>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<?php $this->load->view('system/infocenter/dokpruefung.php'); ?>
|
||||
</div> <!-- ./panel-body -->
|
||||
@@ -85,7 +118,8 @@
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading text-center">
|
||||
<a name="ZgvPruef"></a>
|
||||
<h4>ZGV-Prüfung</h4>
|
||||
<h4><?php echo $this->p->t('infocenter', 'zgv'). ' - '.
|
||||
ucfirst($this->p->t('lehre', 'pruefung'))?></h4>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<?php $this->load->view('system/infocenter/zgvpruefungen.php'); ?><!-- /.panel-group -->
|
||||
@@ -100,7 +134,7 @@
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading text-center">
|
||||
<a name="Nachrichten"></a>
|
||||
<h4 class="text-center">Nachrichten</h4>
|
||||
<h4 class="text-center"><?php echo ucfirst($this->p->t('global', 'nachrichten')) ?></h4>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
@@ -119,7 +153,8 @@
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading text-center">
|
||||
<a name="NotizAkt"></a>
|
||||
<h4 class="text-center">Notizen & Aktivitäten</h4>
|
||||
<h4 class="text-center"><?php echo ucfirst($this->p->t('global', 'notizen')). ' & '.
|
||||
ucfirst($this->p->t('global', 'aktivitaeten')) ?></h4>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
@@ -131,8 +166,11 @@
|
||||
<?php $this->load->view('system/infocenter/notizen.php'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6" id="logs">
|
||||
<div class="col-lg-6">
|
||||
<div id="parking"></div>
|
||||
<div id="logs">
|
||||
<?php $this->load->view('system/infocenter/logs.php'); ?>
|
||||
</div>
|
||||
</div> <!-- ./column -->
|
||||
</div> <!-- ./row -->
|
||||
</div> <!-- ./panel-body -->
|
||||
|
||||
Regular → Executable
+30
-31
@@ -9,6 +9,9 @@
|
||||
'fontawesome' => true,
|
||||
'sbadmintemplate' => true,
|
||||
'tablesorter' => true,
|
||||
'ajaxlib' => true,
|
||||
'filterwidget' => true,
|
||||
'navigationwidget' => true,
|
||||
'customCSSs' => 'public/css/sbadmin2/tablesort_bootstrap.css',
|
||||
'customJSs' => array('public/js/bootstrapper.js', 'public/js/infocenter/infocenterPersonDataset.js')
|
||||
)
|
||||
@@ -66,7 +69,6 @@
|
||||
INNER JOIN public.tbl_prestudent ps USING(prestudent_id)
|
||||
JOIN public.tbl_studiengang USING(studiengang_kz)
|
||||
WHERE pss.status_kurzbz = \'Interessent\'
|
||||
AND pss.bestaetigtam IS NULL
|
||||
AND ps.person_id = p.person_id
|
||||
AND tbl_studiengang.typ in(\'b\')
|
||||
AND studiensemester_kurzbz IN (
|
||||
@@ -85,7 +87,6 @@
|
||||
JOIN public.tbl_studiengang USING(studiengang_kz)
|
||||
WHERE pss.status_kurzbz = \'Interessent\'
|
||||
AND (pss.bewerbung_abgeschicktamum IS NOT NULL AND pss.bewerbung_abgeschicktamum>=\''.$NOTBEFORE.'\')
|
||||
AND pss.bestaetigtam IS NULL
|
||||
AND ps.person_id = p.person_id
|
||||
AND tbl_studiengang.typ in(\'b\')
|
||||
AND studiensemester_kurzbz IN (
|
||||
@@ -104,7 +105,6 @@
|
||||
JOIN public.tbl_studiengang USING(studiengang_kz)
|
||||
WHERE pss.status_kurzbz = \'Interessent\'
|
||||
AND (pss.bewerbung_abgeschicktamum IS NOT NULL AND pss.bewerbung_abgeschicktamum>=\''.$NOTBEFORE.'\')
|
||||
AND pss.bestaetigtam IS NULL
|
||||
AND ps.person_id = p.person_id
|
||||
AND tbl_studiengang.typ in(\'b\')
|
||||
AND studiensemester_kurzbz IN (
|
||||
@@ -123,7 +123,6 @@
|
||||
JOIN public.tbl_studiengang USING(studiengang_kz)
|
||||
WHERE pss.status_kurzbz = \'Interessent\'
|
||||
AND (pss.bewerbung_abgeschicktamum IS NOT NULL AND pss.bewerbung_abgeschicktamum>=\''.$NOTBEFORE.'\')
|
||||
AND pss.bestaetigtam IS NULL
|
||||
AND ps.person_id = p.person_id
|
||||
AND tbl_studiengang.typ in(\'b\')
|
||||
AND studiensemester_kurzbz IN (
|
||||
@@ -147,11 +146,7 @@
|
||||
WHERE
|
||||
person_id=p.person_id
|
||||
AND tbl_studiengang.typ in(\'b\')
|
||||
AND \'Interessent\' = (SELECT status_kurzbz FROM public.tbl_prestudentstatus
|
||||
WHERE prestudent_id=tbl_prestudent.prestudent_id
|
||||
ORDER BY datum DESC, insertamum DESC, ext_id DESC
|
||||
LIMIT 1
|
||||
)
|
||||
|
||||
AND EXISTS (
|
||||
SELECT
|
||||
1
|
||||
@@ -160,7 +155,7 @@
|
||||
WHERE
|
||||
prestudent_id = tbl_prestudent.prestudent_id
|
||||
AND status_kurzbz = \'Interessent\'
|
||||
AND (bestaetigtam IS NOT NULL AND (bewerbung_abgeschicktamum is null OR bewerbung_abgeschicktamum>=\''.$NOTBEFORE.'\'))
|
||||
AND (bestaetigtam IS NOT NULL AND bewerbung_abgeschicktamum >= \''.$NOTBEFORE.'\')
|
||||
AND studiensemester_kurzbz IN (
|
||||
SELECT studiensemester_kurzbz
|
||||
FROM public.tbl_studiensemester
|
||||
@@ -168,19 +163,33 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
ORDER BY "LastAction" ASC
|
||||
ORDER BY "LastAction" DESC
|
||||
',
|
||||
'fhc_controller_id' => $fhc_controller_id,
|
||||
'requiredPermissions' => 'infocenter',
|
||||
'checkboxes' => 'PersonId',
|
||||
'additionalColumns' => array('Details'),
|
||||
'columnsAliases' => array('PersonID','Vorname','Nachname','GebDatum','Nation','Letzte Aktion','Letzter Bearbeiter',
|
||||
'StSem','GesendetAm','NumAbgeschickt','Studiengänge','Sperrdatum','GesperrtVon'),
|
||||
'formatRaw' => function($datasetRaw) {
|
||||
'columnsAliases' => array(
|
||||
'PersonID',
|
||||
'Vorname',
|
||||
'Nachname',
|
||||
'GebDatum',
|
||||
'Nation',
|
||||
'Letzte Aktion',
|
||||
'Letzter Bearbeiter',
|
||||
'StSem',
|
||||
'GesendetAm',
|
||||
'NumAbgeschickt',
|
||||
'Studiengänge',
|
||||
'Sperrdatum',
|
||||
'GesperrtVon'
|
||||
),
|
||||
'formatRow' => function($datasetRaw) {
|
||||
|
||||
$datasetRaw->{'Details'} = sprintf(
|
||||
'<a href="%s%s">Details</a>',
|
||||
base_url('index.ci.php/system/infocenter/InfoCenter/showDetails/'),
|
||||
$datasetRaw->{'PersonId'}
|
||||
'<a href="%s/%s?show_lock_link=0&fhc_controller_id=%s">Details</a>',
|
||||
site_url('system/infocenter/InfoCenter/showDetails'),
|
||||
$datasetRaw->{'PersonId'},
|
||||
(isset($_GET['fhc_controller_id'])?$_GET['fhc_controller_id']:'')
|
||||
);
|
||||
|
||||
if ($datasetRaw->{'SendDate'} == null)
|
||||
@@ -237,19 +246,9 @@
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
$filterId = isset($_GET[InfoCenter::FILTER_ID]) ? $_GET[InfoCenter::FILTER_ID] : null;
|
||||
|
||||
if (isset($filterId) && is_numeric($filterId))
|
||||
{
|
||||
$filterWidgetArray[InfoCenter::FILTER_ID] = $filterId;
|
||||
}
|
||||
else
|
||||
{
|
||||
$filterWidgetArray['app'] = $APP;
|
||||
$filterWidgetArray['datasetName'] = 'PersonActions';
|
||||
$filterWidgetArray['filterKurzbz'] = 'InfoCenterNotSentApplicationAll';
|
||||
}
|
||||
$filterWidgetArray[InfoCenter::FILTER_ID] = $this->input->get(InfoCenter::FILTER_ID);
|
||||
$filterWidgetArray['app'] = $APP;
|
||||
$filterWidgetArray['datasetName'] = 'PersonActions';
|
||||
|
||||
echo $this->widgetlib->widget('FilterWidget', $filterWidgetArray);
|
||||
?>
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
<table id="logtable" class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Datum</th>
|
||||
<th>Aktivität</th>
|
||||
<th>User</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($logs as $log): ?>
|
||||
<tr data-toggle="tooltip"
|
||||
title="<?php echo isset($log->logdata->message) ? $log->logdata->message : '' ?>">
|
||||
<td><?php echo date_format(date_create($log->zeitpunkt), 'd.m.Y H:i:s') ?></td>
|
||||
<td><?php echo isset($log->logdata->name) ? $log->logdata->name : '' ?></td>
|
||||
<td><?php echo $log->insertvon ?></td>
|
||||
</tr>
|
||||
<?php endforeach ?>
|
||||
</tbody>
|
||||
<table id="logtable" class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php echo ucfirst($this->p->t('global', 'datum')) ?></th>
|
||||
<th><?php echo ucfirst($this->p->t('global', 'aktivitaet')) ?></th>
|
||||
<th>User</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($logs as $log): ?>
|
||||
<tr data-toggle="tooltip"
|
||||
title="<?php echo isset($log->logdata->message) ? $log->logdata->message : '' ?>">
|
||||
<td><?php echo date_format(date_create($log->zeitpunkt), 'd.m.Y H:i:s') ?></td>
|
||||
<td><?php echo isset($log->logdata->name) ? $log->logdata->name : '' ?></td>
|
||||
<td><?php echo $log->insertvon ?></td>
|
||||
</tr>
|
||||
<?php endforeach ?>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -1,8 +1,8 @@
|
||||
<table id="notiztable" class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Datum</th>
|
||||
<th>Notiz</th>
|
||||
<th><?php echo ucfirst($this->p->t('global', 'datum')) ?></th>
|
||||
<th><?php echo ucfirst($this->p->t('global', 'notiz')) ?></th>
|
||||
<th>User</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -2,41 +2,41 @@
|
||||
<div class="col-lg-6 table-responsive">
|
||||
<table class="table">
|
||||
<tr>
|
||||
<td><strong>Vorname</strong></td>
|
||||
<td><strong><?php echo ucfirst($this->p->t('person','vorname')) ?></strong></td>
|
||||
<td><?php echo $stammdaten->vorname ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Nachname</strong></td>
|
||||
<td><strong><?php echo ucfirst($this->p->t('person','nachname')) ?></strong></td>
|
||||
<td>
|
||||
<?php echo $stammdaten->nachname ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Geburtsdatum</strong></td>
|
||||
<td><strong><?php echo ucfirst($this->p->t('person','geburtsdatum')) ?></strong></td>
|
||||
<td>
|
||||
<?php echo date_format(date_create($stammdaten->gebdatum), 'd.m.Y') ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Sozialversicherungsnr</strong></td>
|
||||
<td><strong><?php echo ucfirst($this->p->t('person','svnr')) ?></strong></td>
|
||||
<td>
|
||||
<?php echo $stammdaten->svnr ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Staatsbürgerschaft</strong></td>
|
||||
<td><strong><?php echo ucfirst($this->p->t('person','staatsbuergerschaft')) ?></strong></td>
|
||||
<td>
|
||||
<?php echo $stammdaten->staatsbuergerschaft ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Geschlecht</strong></td>
|
||||
<td><strong><?php echo ucfirst($this->p->t('person','geschlecht')) ?></strong></td>
|
||||
<td>
|
||||
<?php echo $stammdaten->geschlecht ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Geburtsnation</strong></td>
|
||||
<td><strong><?php echo ucfirst($this->p->t('person','geburtsnation')) ?></strong></td>
|
||||
<td>
|
||||
<?php echo $stammdaten->geburtsnation ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Geburtsort</strong></td>
|
||||
<td><strong><?php echo ucfirst($this->p->t('person','geburtsort')) ?></strong></td>
|
||||
<td><?php echo $stammdaten->gebort ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -45,18 +45,22 @@
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="4" class="text-center">Kontakte</th>
|
||||
<th colspan="4" class="text-center"><?php echo ucfirst($this->p->t('global','kontakt')) ?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="text-center">Typ</th>
|
||||
<th class="text-center">Kontakt</th>
|
||||
<th class="text-center">Anmerkung</th>
|
||||
<th class="text-center"><?php echo ucfirst($this->p->t('global','typ')) ?></th>
|
||||
<th class="text-center"><?php echo ucfirst($this->p->t('global','kontakt')) ?></th>
|
||||
<th class="text-center"><?php echo ucfirst($this->p->t('global','anmerkung')) ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($stammdaten->kontakte as $kontakt): ?>
|
||||
<tr>
|
||||
<td><?php echo ucfirst($kontakt->kontakttyp); ?></td>
|
||||
<?php if ($kontakt->kontakttyp === 'email'): ?>
|
||||
<td><?php echo ucfirst($this->p->t('person','email')) ?></td>
|
||||
<?php elseif ($kontakt->kontakttyp === 'telefon'): ?>
|
||||
<td><?php echo ucfirst($this->p->t('person','telefon')) ?></td>
|
||||
<?php endif; ?>
|
||||
<td>
|
||||
<?php echo '<span class="'.$kontakt->kontakttyp.'">';?>
|
||||
<?php if ($kontakt->kontakttyp === 'email'): ?>
|
||||
@@ -76,7 +80,7 @@
|
||||
<?php foreach ($stammdaten->adressen as $adresse): ?>
|
||||
<tr>
|
||||
<td>
|
||||
Adresse
|
||||
<?php echo ucfirst($this->p->t('person','adresse')) ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo isset($adresse) ? $adresse->strasse.', '.$adresse->plz.' '.$adresse->ort : '' ?>
|
||||
@@ -97,13 +101,13 @@
|
||||
<input type="hidden" name="person_id"
|
||||
value="<?php echo $stammdaten->person_id ?>">
|
||||
<a id="sendmsglink" href="javascript:void(0);"><i
|
||||
class="fa fa-envelope"></i> Nachricht senden</a>
|
||||
class="fa fa-envelope"></i> <?php echo $this->p->t('ui','nachrichtSenden') ?></a>
|
||||
</form>
|
||||
</div>
|
||||
<?php if (isset($stammdaten->zugangscode)): ?>
|
||||
<div class="col-xs-6 text-right">
|
||||
<a href="<?php echo CIS_ROOT.'addons/bewerbung/cis/registration.php?code='.html_escape($stammdaten->zugangscode) ?>"
|
||||
target='_blank'><i class="glyphicon glyphicon-new-window"></i> Zugang Bewerbung</a>
|
||||
target='_blank'><i class="glyphicon glyphicon-new-window"></i> <?php echo $this->p->t('infocenter','zugangBewerbung') ?></a>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
@@ -17,13 +17,13 @@ $this->load->view(
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<h3 class="page-header">Zugangsvoraussetzungen <?php echo $studiengang_kurzbz; ?> - <?php echo $studiengang_bezeichnung; ?></h3>
|
||||
<h3 class="page-header"><?php echo $this->p->t('infocenter', 'zugangsvoraussetzungen'); ?> <?php echo $studiengang_kurzbz; ?> - <?php echo $studiengang_bezeichnung; ?></h3>
|
||||
</div>
|
||||
</div>
|
||||
<div id="data">
|
||||
<?php if (empty($data)): ?>
|
||||
Keine Zugangsvoraussetzungen für den Studiengang definiert
|
||||
<?php
|
||||
<?php echo $this->p->t('infocenter', 'keineZugangsvoraussetzungenTxt'); ?>
|
||||
<?php
|
||||
else:
|
||||
echo json_decode($data);
|
||||
endif;
|
||||
|
||||
@@ -27,14 +27,14 @@
|
||||
<?php if (isset($zgvpruefung->prestudentstatus->bestaetigtam)): ?>
|
||||
<div class="col-xs-<?php echo $headercolumns[1]; ?> text-right">
|
||||
<i class="fa fa-check" style="color: green"></i>
|
||||
An Studiengang freigegeben
|
||||
<?php echo $this->p->t('global', 'anStudiengangFreigegeben') ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php else: ?>
|
||||
<div class="col-xs-<?php echo $headercolumns[1]; ?> text-right">
|
||||
<?php echo 'Bewerbung abgeschickt: '.(isset($zgvpruefung->prestudentstatus->bewerbung_abgeschicktamum) ? '<i class="fa fa-check" style="color:green"></i>' : '<i class="fa fa-times" style="color:red"></i>'); ?>
|
||||
<?php echo (isset($zgvpruefung->prestudentstatus->bewerbungsnachfrist) ? ' | Nachfrist: '. date_format(date_create($zgvpruefung->prestudentstatus->bewerbungsnachfrist), 'd.m.Y') : ''); ?>
|
||||
<?php echo (isset($zgvpruefung->prestudentstatus->bewerbungstermin) ? ' | Bewerbungsfrist: '. date_format(date_create($zgvpruefung->prestudentstatus->bewerbungstermin), 'd.m.Y') : ''); ?>
|
||||
<?php echo ucfirst($this->p->t('infocenter','bewerbung')) . ' ' . $this->p->t('global','abgeschickt') . ': '.(isset($zgvpruefung->prestudentstatus->bewerbung_abgeschicktamum) ? '<i class="fa fa-check" style="color:green"></i>' : '<i class="fa fa-times" style="color:red"></i>'); ?>
|
||||
<?php echo (isset($zgvpruefung->prestudentstatus->bewerbungsnachfrist) ? ' | ' . $this->p->t('infocenter', 'nachfrist') . ': ' . date_format(date_create($zgvpruefung->prestudentstatus->bewerbungsnachfrist), 'd.m.Y') : ''); ?>
|
||||
<?php echo (isset($zgvpruefung->prestudentstatus->bewerbungstermin) ? ' | ' . $this->p->t('infocenter', 'bewerbungsfrist') . ': ' . date_format(date_create($zgvpruefung->prestudentstatus->bewerbungstermin), 'd.m.Y') : ''); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
@@ -49,7 +49,7 @@
|
||||
<div class="row">
|
||||
<div class="col-lg-<?php echo $columns[0] ?>">
|
||||
<div class="form-group">
|
||||
<label>Letzter Status: </label>
|
||||
<label><?php echo ucfirst($this->p->t('global','letzterStatus')) . ':' ?></label>
|
||||
<?php
|
||||
if (isset($zgvpruefung->prestudentstatus->status_kurzbz))
|
||||
{
|
||||
@@ -60,7 +60,7 @@
|
||||
</div>
|
||||
<div class="col-lg-<?php echo $columns[1] ?>">
|
||||
<div class="form-group">
|
||||
<label>Studiensemester: </label>
|
||||
<label><?php echo ucfirst($this->p->t('lehre','studiensemester')) . ':' ?></label>
|
||||
<?php echo isset($zgvpruefung->prestudentstatus->studiensemester_kurzbz) ? $zgvpruefung->prestudentstatus->studiensemester_kurzbz : '' ?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -73,7 +73,7 @@
|
||||
</div>
|
||||
<div class="col-lg-<?php echo $columns[3] ?>">
|
||||
<div class="form-group">
|
||||
<label>Orgform: </label>
|
||||
<label><?php echo ucfirst($this->p->t('lehre','organisationsform')) . ':' ?></label>
|
||||
<span style="display: inline-block">
|
||||
<?php
|
||||
$separator = (isset($zgvpruefung->prestudentstatus->orgform)) ? ', ' : '';
|
||||
@@ -90,18 +90,18 @@
|
||||
<div class="row">
|
||||
<?php if ($infoonly): ?>
|
||||
<div class="col-xs-8">
|
||||
<label>ZGV:</label>
|
||||
<label><?php echo $this->p->t('infocenter', 'zgv') . ':' ?></label>
|
||||
<?php echo $zgvpruefung->zgv_bez; ?>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div class="col-xs-3">
|
||||
<label>ZGV:</label>
|
||||
<label><?php echo $this->p->t('infocenter', 'zgv') . ':' ?></label>
|
||||
</div>
|
||||
<?php endif;
|
||||
$zgvinfocolumns = $infoonly ? 4 : 9;
|
||||
?>
|
||||
<div class="col-xs-<?php echo $zgvinfocolumns; ?> text-right zgvinfo" id="zgvinfo_<?php echo $zgvpruefung->prestudent_id ?>">
|
||||
<a href="javascript:void(0)"><i class="fa fa-info-circle"></i> ZGV <?php echo $zgvpruefung->studiengang; ?></a>
|
||||
<a href="javascript:void(0)"><i class="fa fa-info-circle"></i> <?php echo $this->p->t('infocenter', 'zgv') ?> <?php echo $zgvpruefung->studiengang; ?></a>
|
||||
</div>
|
||||
</div>
|
||||
<?php if (!$infoonly)
|
||||
@@ -114,7 +114,7 @@
|
||||
</div>
|
||||
<div class="col-lg-<?php echo $columns[1] ?>">
|
||||
<div class="form-group">
|
||||
<label>ZGV Ort: </label>
|
||||
<label><?php echo $this->p->t('infocenter', 'zgv') . ' ' . $this->p->t('person','ort') . ':'?></label>
|
||||
<?php if ($infoonly):
|
||||
echo html_escape($zgvpruefung->zgvort);
|
||||
else:
|
||||
@@ -127,7 +127,7 @@
|
||||
</div>
|
||||
<div class="col-lg-<?php echo $columns[2] ?>">
|
||||
<div class="form-group">
|
||||
<label>ZGV Datum: </label>
|
||||
<label><?php echo $this->p->t('infocenter', 'zgv') . ' ' . $this->p->t('global','datum') . ':'?></label>
|
||||
<?php
|
||||
$zgvdatum = empty($zgvpruefung->zgvdatum) ? "" : date_format(date_create($zgvpruefung->zgvdatum), 'd.m.Y');
|
||||
if ($infoonly):
|
||||
@@ -143,7 +143,7 @@
|
||||
</div>
|
||||
<div class="col-lg-<?php echo $columns[3] ?>">
|
||||
<div class="form-group">
|
||||
<label>ZGV Nation: </label>
|
||||
<label><?php echo $this->p->t('infocenter', 'zgv') . ' ' . $this->p->t('person','nation') . ':'?></label>
|
||||
<?php if ($infoonly)
|
||||
echo $zgvpruefung->zgvnation_bez;
|
||||
else
|
||||
@@ -159,7 +159,7 @@
|
||||
<?php if ($zgvpruefung->studiengangtyp === 'm') : ?>
|
||||
<div class="row">
|
||||
<div class="col-lg-<?php echo $columns[0] ?>">
|
||||
<div class="form-group"><label>ZGV Master: </label>
|
||||
<div class="form-group"><label><?php echo $this->p->t('infocenter', 'zgv') . ' ' . $this->p->t('lehre','master') . ':'?></label>
|
||||
<?php
|
||||
if ($infoonly)
|
||||
echo $zgvpruefung->zgvmas_bez;
|
||||
@@ -173,7 +173,7 @@
|
||||
</div>
|
||||
<div class="col-lg-<?php echo $columns[1] ?>">
|
||||
<div class="form-group">
|
||||
<label>ZGV Master Ort: </label>
|
||||
<label><?php echo $this->p->t('infocenter', 'zgv') . ' ' . $this->p->t('lehre','master') . ' ' . $this->p->t('person','ort') . ':'?></label>
|
||||
<?php if ($infoonly):
|
||||
echo $zgvpruefung->zgvmaort;
|
||||
else:
|
||||
@@ -186,7 +186,7 @@
|
||||
</div>
|
||||
<div class="col-lg-<?php echo $columns[2] ?>">
|
||||
<div class="form-group">
|
||||
<label>ZGV Master Datum: </label>
|
||||
<label><?php echo $this->p->t('infocenter', 'zgv') . ' ' . $this->p->t('lehre','master') . ' ' . $this->p->t('global','datum') . ':'?></label>
|
||||
<?php
|
||||
$zgvmadatum = empty($zgvpruefung->zgvmadatum) ? "" : date_format(date_create($zgvpruefung->zgvmadatum), 'd.m.Y');
|
||||
if ($infoonly):
|
||||
@@ -201,8 +201,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-<?php echo $columns[3] ?>">
|
||||
<div class="form-group"><label>ZGV Master
|
||||
Nation: </label>
|
||||
<div class="form-group"><label><?php echo $this->p->t('infocenter', 'zgv') . ' ' . $this->p->t('lehre','master') . ' ' . $this->p->t('person', 'nation') . ':'?></label>
|
||||
<?php
|
||||
if ($infoonly)
|
||||
echo $zgvpruefung->zgvmanation_bez;
|
||||
@@ -221,12 +220,12 @@
|
||||
<div class="row">
|
||||
<div class="col-xs-6 text-left">
|
||||
<button type="button" class="btn btn-default zgvUebernehmen" id="zgvUebernehmen_<?php echo $zgvpruefung->prestudent_id ?>">
|
||||
Letzte ZGV übernehmen
|
||||
<?php echo $this->p->t('infocenter', 'letzteZgvUebernehmen') ?>
|
||||
</button>
|
||||
</div>
|
||||
<div class="col-xs-6 text-right">
|
||||
<button type="submit" class="btn btn-default saveZgv" id="zgvSpeichern_<?php echo $zgvpruefung->prestudent_id ?>">
|
||||
Speichern
|
||||
<?php echo $this->p->t('ui', 'speichern') ?>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -244,13 +243,13 @@
|
||||
<div class="form-inline">
|
||||
<form method="post"
|
||||
action="../saveAbsage/<?php echo $zgvpruefung->prestudent_id ?>">
|
||||
<input type="hidden" name="fhc_controller_id" value="<?php echo $fhc_controller_id; ?>">
|
||||
<div class="input-group" id="statusgrselect_<?php echo $zgvpruefung->prestudent_id ?>">
|
||||
<select name="statusgrund"
|
||||
class="d-inline float-right"
|
||||
required>
|
||||
<option value="null"
|
||||
selected="selected">Absagegrund
|
||||
wählen...
|
||||
selected="selected"><?php echo ucfirst($this->p->t('infocenter', 'absagegrund')) . '...' ?>
|
||||
</option>
|
||||
<?php foreach ($statusgruende as $statusgrund): ?>
|
||||
<option value="<?php echo $statusgrund->statusgrund_id ?>"><?php echo $statusgrund->bezeichnung_mehrsprachig[0] ?></option>
|
||||
@@ -261,7 +260,7 @@
|
||||
class="btn btn-default"
|
||||
data-toggle="modal"
|
||||
data-target="#absageModal_<?php echo $zgvpruefung->prestudent_id ?>">
|
||||
Absage
|
||||
<?php echo $this->p->t('ui', 'absagen') ?>
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
@@ -280,33 +279,20 @@
|
||||
×
|
||||
</button>
|
||||
<h4 class="modal-title"
|
||||
id="absageModalLabel">Absage
|
||||
bestätigen</h4>
|
||||
id="absageModalLabel"><?php echo $this->p->t('infocenter', 'absageBestaetigen') ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
Bei Absage von InteressentInnen
|
||||
erhalten
|
||||
diese den Status "Abgewiesener"
|
||||
und<br/>deren
|
||||
Zgvdaten können
|
||||
im Infocenter nicht mehr
|
||||
bearbeitet
|
||||
oder
|
||||
freigegeben werden.
|
||||
<br/>Alle nicht gespeicherten
|
||||
Zgvdaten
|
||||
gehen
|
||||
verloren. Fortfahren?
|
||||
<?php echo $this->p->t('infocenter', 'absageBestaetigenTxt') ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button"
|
||||
class="btn btn-default"
|
||||
data-dismiss="modal">
|
||||
Abbrechen
|
||||
<?php echo $this->p->t('ui', 'abbrechen') ?>
|
||||
</button>
|
||||
<button type="submit"
|
||||
class="btn btn-primary">
|
||||
InteressentIn abweisen
|
||||
<?php echo $this->p->t('infocenter', 'interessentAbweisen') ?>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -337,7 +323,7 @@
|
||||
data-toggle="modal"
|
||||
data-target="#freigabeModal_<?php echo $zgvpruefung->prestudent_id ?>"
|
||||
data-toggle="tooltip" title="<?php echo $disabledTxt ?>">
|
||||
Freigabe an Studiengang
|
||||
<?php echo $this->p->t('ui', 'freigabeAnStudiengang') ?>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -354,29 +340,20 @@
|
||||
</button>
|
||||
<h4 class="modal-title"
|
||||
id="freigabeModalLabel">
|
||||
Freigabe
|
||||
bestätigen</h4>
|
||||
<?php echo $this->p->t('infocenter', 'freigabeBestaetigen') ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
Bei Freigabe von InteressentInnen wird deren
|
||||
Interessentenstatus bestätigt und<br/>deren
|
||||
Zgvdaten
|
||||
können im
|
||||
Infocenter nicht mehr bearbeitet
|
||||
werden.
|
||||
<br/>Alle nicht gespeicherten Zgvdaten gehen
|
||||
verloren.
|
||||
Fortfahren?
|
||||
<?php echo $this->p->t('infocenter', 'interessentFreigebenTxt') ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button"
|
||||
class="btn btn-default"
|
||||
data-dismiss="modal">Abbrechen
|
||||
data-dismiss="modal"><?php echo $this->p->t('ui', 'abbrechen') ?>
|
||||
</button>
|
||||
<a href="../saveFreigabe/<?php echo $zgvpruefung->prestudent_id ?>">
|
||||
<a href="../saveFreigabe/<?php echo $zgvpruefung->prestudent_id ?>?fhc_controller_id=<?php echo $fhc_controller_id; ?>">
|
||||
<button type="button"
|
||||
class="btn btn-primary">
|
||||
InteressentIn freigeben
|
||||
<?php echo $this->p->t('infocenter', 'interessentFreigeben') ?>
|
||||
</button>
|
||||
</a>
|
||||
</div>
|
||||
@@ -390,7 +367,7 @@
|
||||
<div class="row">
|
||||
<div class="col-lg-12 text-left">
|
||||
<?php echo isset($zgvpruefung->prestudentstatus->bestaetigtam) ? '<i class="fa fa-check" style="color: green"></i>' : '<i class="fa fa-check" style="color: red"></i>' ?>
|
||||
<label>An Studiengang freigegeben</label>
|
||||
<label><?php echo $this->p->t('global', 'anStudiengangFreigegeben') ?></label>
|
||||
</div>
|
||||
</div><!-- /.row -->
|
||||
</div><!-- /.panel-footer -->
|
||||
|
||||
@@ -1,97 +1,100 @@
|
||||
<?php
|
||||
$msgExists = count($messages) > 0;
|
||||
$widthColumn = $msgExists === true ? 8 : 12;
|
||||
?>
|
||||
<div class="col-lg-<?php echo $widthColumn ?>">
|
||||
<table id="msgtable" class="table table-bordered table-condensed tablesort-hover tablesort-active">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Gesendet am</th>
|
||||
<th>Sender</th>
|
||||
<th>Empfänger</th>
|
||||
<th>Betreff</th>
|
||||
<th>Gelesen am</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($messages as $message): ?>
|
||||
<tr id="<?php echo $message->message_id.'_'.$message->repersonid ?>" style="cursor: pointer">
|
||||
<td><?php echo isset($message->insertamum) ? date_format(date_create($message->insertamum), 'd.m.Y H:i:s') : '' ?></td>
|
||||
<td><?php echo $message->sevorname.' '.$message->senachname ?></td>
|
||||
<td><?php echo $message->revorname.' '.$message->renachname ?></td>
|
||||
<td><?php echo $message->subject ?></td>
|
||||
<td><?php echo isset($message->statusamum) ? date_format(date_create($message->statusamum), 'd.m.Y H:i:s') : '' ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php if ($msgExists === true): ?>
|
||||
<div class="col-lg-4">
|
||||
<br>
|
||||
<div class="text-center"><label for="msgbody" id="msgsubject"></label></div>
|
||||
<div>
|
||||
<textarea id="msgbody"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<script>
|
||||
tinymce.init({
|
||||
menubar: false,
|
||||
toolbar: false,
|
||||
readonly: 1,
|
||||
selector: "#msgbody",
|
||||
statusbar: false,
|
||||
plugins: "autoresize",
|
||||
//callback to avoid conflict with ajax (for getting body of first message)
|
||||
init_instance_callback: "initMsgBody"
|
||||
});
|
||||
|
||||
function initMsgBody()
|
||||
{
|
||||
var tblrows = $("#msgtable tbody tr");
|
||||
|
||||
if (tblrows.length > 0)
|
||||
{
|
||||
//in the begging last sent message is shown
|
||||
var firstelement = tblrows.first();
|
||||
var id = firstelement.attr('id');
|
||||
|
||||
getMsgBody(id);
|
||||
firstelement.find("td").addClass("tablesort-active");
|
||||
|
||||
//add click event on message table for message preview
|
||||
tblrows.click(
|
||||
function ()
|
||||
{
|
||||
$("#msgtable").find("td").removeClass("tablesort-active");
|
||||
$(this).find("td").addClass("tablesort-active");
|
||||
getMsgBody(this.id);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
//retrieve message data from message and reiver id via AJAX
|
||||
function getMsgBody(id)
|
||||
{
|
||||
var msgid = id.substr(0, id.indexOf('_'));
|
||||
var recid = id.substr(id.indexOf('_') + 1);
|
||||
|
||||
$.ajax(
|
||||
{
|
||||
dataType: "json",
|
||||
url: "<?php echo base_url("/index.ci.php/system/Messages/getMessageFromIds/") ?>" + msgid + "/" + recid,
|
||||
success: function (data, textStatus, jqXHR)
|
||||
{
|
||||
$("#msgsubject").text(data[0].subject);
|
||||
tinyMCE.get("msgbody").setContent(data[0].body);
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown)
|
||||
{
|
||||
alert(textStatus + " - " + errorThrown + " - " + jqXHR.responseText);
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
<?php
|
||||
$msgExists = count($messages) > 0;
|
||||
$widthColumn = $msgExists === true ? 8 : 12;
|
||||
?>
|
||||
<div class="col-lg-<?php echo $widthColumn ?>">
|
||||
<table id="msgtable" class="table table-bordered table-condensed tablesort-hover tablesort-active">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php echo ucfirst($this->p->t('global','gesendetAm')) ?></th>
|
||||
<th><?php echo ucfirst($this->p->t('global','sender')) ?></th>
|
||||
<th><?php echo ucfirst($this->p->t('global','empfaenger')) ?></th>
|
||||
<th><?php echo ucfirst($this->p->t('global','betreff')) ?></th>
|
||||
<th><?php echo ucfirst($this->p->t('global','gelesenAm')) ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($messages as $message): ?>
|
||||
<tr id="<?php echo $message->message_id.'_'.$message->repersonid ?>" style="cursor: pointer">
|
||||
<td><?php echo isset($message->insertamum) ? date_format(date_create($message->insertamum), 'd.m.Y H:i:s') : '' ?></td>
|
||||
<td><?php echo $message->sevorname.' '.$message->senachname ?></td>
|
||||
<td><?php echo $message->revorname.' '.$message->renachname ?></td>
|
||||
<td><?php echo $message->subject ?></td>
|
||||
<td><?php echo isset($message->statusamum) ? date_format(date_create($message->statusamum), 'd.m.Y H:i:s') : '' ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php if ($msgExists === true): ?>
|
||||
<div class="col-lg-4">
|
||||
<br>
|
||||
<div class="text-center"><label for="msgbody" id="msgsubject"></label></div>
|
||||
<div>
|
||||
<textarea id="msgbody"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<script>
|
||||
tinymce.init({
|
||||
menubar: false,
|
||||
toolbar: false,
|
||||
readonly: 1,
|
||||
selector: "#msgbody",
|
||||
statusbar: false,
|
||||
plugins: "autoresize",
|
||||
autoresize_bottom_margin: 10,
|
||||
autoresize_min_height: 140,
|
||||
autoresize_max_height: 495,
|
||||
//callback to avoid conflict with ajax (for getting body of first message)
|
||||
init_instance_callback: "initMsgBody"
|
||||
});
|
||||
|
||||
function initMsgBody()
|
||||
{
|
||||
var tblrows = $("#msgtable tbody tr");
|
||||
|
||||
if (tblrows.length > 0)
|
||||
{
|
||||
//in the begging last sent message is shown
|
||||
var firstelement = tblrows.first();
|
||||
var id = firstelement.attr('id');
|
||||
|
||||
getMsgBody(id);
|
||||
firstelement.find("td").addClass("tablesort-active");
|
||||
|
||||
//add click event on message table for message preview
|
||||
tblrows.click(
|
||||
function ()
|
||||
{
|
||||
$("#msgtable").find("td").removeClass("tablesort-active");
|
||||
$(this).find("td").addClass("tablesort-active");
|
||||
getMsgBody(this.id);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
//retrieve message data from message and reiver id via AJAX
|
||||
function getMsgBody(id)
|
||||
{
|
||||
var msgid = id.substr(0, id.indexOf('_'));
|
||||
var recid = id.substr(id.indexOf('_') + 1);
|
||||
|
||||
$.ajax(
|
||||
{
|
||||
dataType: "json",
|
||||
url: "<?php echo base_url("/index.ci.php/system/Messages/getMessageFromIds/") ?>" + msgid + "/" + recid,
|
||||
success: function (data, textStatus, jqXHR)
|
||||
{
|
||||
$("#msgsubject").text(data[0].subject);
|
||||
tinyMCE.get("msgbody").setContent(data[0].body);
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown)
|
||||
{
|
||||
alert(textStatus + " - " + errorThrown + " - " + jqXHR.responseText);
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
</script>
|
||||
@@ -22,11 +22,82 @@ $href = site_url().'/system/Messages/send/';
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<h3 class="page-header">Send Message</h3>
|
||||
<h3 class="page-header"><?php echo ucfirst($this->p->t('ui', 'nachrichtSenden')) ?></h3>
|
||||
</div>
|
||||
</div>
|
||||
<form id="sendForm" method="post" action="<?php echo $href; ?>">
|
||||
<?php $this->load->view('system/messageForm.php'); ?>
|
||||
<div class="row">
|
||||
<div class="form-group">
|
||||
<div class="col-lg-1">
|
||||
<label><?php echo ucfirst($this->p->t('global', 'empfaenger')) . ':'?></label>
|
||||
</div>
|
||||
<div class="col-lg-11">
|
||||
<?php
|
||||
for ($i = 0; $i < count($receivers); $i++)
|
||||
{
|
||||
$receiver = $receivers[$i];
|
||||
// Every 10 recipients a new line
|
||||
if ($i > 1 && $i % 10 == 0)
|
||||
{
|
||||
echo '<br>';
|
||||
}
|
||||
echo $receiver->Vorname." ".$receiver->Nachname."; ";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="form-group form-inline">
|
||||
<div class="col-lg-1 msgfield">
|
||||
<label><?php echo ucfirst($this->p->t('global', 'betreff')) . ':'?></label>
|
||||
</div>
|
||||
<?php
|
||||
$subject = '';
|
||||
if (isset($message))
|
||||
{
|
||||
$subject = 'Re: '.$message->subject;
|
||||
}
|
||||
?>
|
||||
<div class="col-lg-10">
|
||||
<input id="subject" class="form-control" type="text" value="<?php echo $subject; ?>"
|
||||
name="subject" size="70">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="row">
|
||||
<div class="col-lg-10">
|
||||
<label><?php echo ucfirst($this->p->t('global', 'nachricht')) . ':'?></label>
|
||||
<?php
|
||||
$body = '';
|
||||
if (isset($message))
|
||||
{
|
||||
$body = $message->body;
|
||||
}
|
||||
?>
|
||||
<textarea id="bodyTextArea" name="body"><?php echo $body; ?></textarea>
|
||||
</div>
|
||||
<?php
|
||||
if (isset($variables)):
|
||||
?>
|
||||
<div class="col-lg-2">
|
||||
<div class="form-group">
|
||||
<label><?php echo ucfirst($this->p->t('ui', 'felder')) . ':'?></label>
|
||||
<select id="variables" class="form-control" size="14" multiple="multiple">
|
||||
<?php
|
||||
foreach ($variables as $key => $val)
|
||||
{
|
||||
?>
|
||||
<option value="<?php echo $key; ?>"><?php echo $val; ?></option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<br>
|
||||
<div class="row">
|
||||
<div class="col-lg-3 text-right">
|
||||
@@ -38,21 +109,24 @@ $href = site_url().'/system/Messages/send/';
|
||||
);
|
||||
?>
|
||||
</div>
|
||||
<div class="col-lg-offset-6 col-lg-1 text-right">
|
||||
<button id="sendButton" class="btn btn-default" type="button"><?php echo $this->p->t('ui', 'senden')?></button>
|
||||
</div>
|
||||
</div>
|
||||
<?php if (isset($receivers) && count($receivers) > 0): ?>
|
||||
<hr>
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<label>Preview:</label>
|
||||
<label><?php echo ucfirst($this->p->t('global', 'vorschau')) . ':'?></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="well">
|
||||
<div class="row">
|
||||
<div class="col-lg-5">
|
||||
<div class="form-grop form-inline">
|
||||
<label>Recipient:</label>
|
||||
<label><?php echo ucfirst($this->p->t('global', 'empfaenger')) . ': ' ?></label>
|
||||
<select id="recipients">
|
||||
<?php
|
||||
<?php
|
||||
if (count($receivers) > 1)
|
||||
echo '<option value="-1">Select...</option>';
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
// Retrives the URL path of the called controller + controller method
|
||||
// Retrives the URL path of the called controller + called controller method
|
||||
// NOTE: placed here because it doesn't work inside functions
|
||||
$calledPath = $this->router->directory.$this->router->class;
|
||||
$calledMethod = $this->router->method;
|
||||
@@ -11,16 +11,20 @@ $calledMethod = $this->router->method;
|
||||
$title = isset($title) ? $title : null;
|
||||
$customCSSs = isset($customCSSs) ? $customCSSs : null;
|
||||
$customJSs = isset($customJSs) ? $customJSs : null;
|
||||
$phrases = isset($phrases) ? $phrases : null;
|
||||
|
||||
// By default set the parameters to false
|
||||
$jquery = isset($jquery) ? $jquery : false;
|
||||
$jqueryui = isset($jqueryui) ? $jqueryui : false;
|
||||
$ajaxlib = isset($ajaxlib) ? $ajaxlib : false;
|
||||
$bootstrap = isset($bootstrap) ? $bootstrap : false;
|
||||
$fontawesome = isset($fontawesome) ? $fontawesome : false;
|
||||
$tablesorter = isset($tablesorter) ? $tablesorter : false;
|
||||
$tinymce = isset($tinymce) ? $tinymce : false;
|
||||
$sbadmintemplate = isset($sbadmintemplate) ? $sbadmintemplate : false;
|
||||
$addons = isset($addons) ? $addons : false;
|
||||
$filterwidget = isset($filterwidget) ? $filterwidget : false;
|
||||
$navigationwidget = isset($navigationwidget) ? $navigationwidget : false;
|
||||
|
||||
/**
|
||||
* Print the given title of the page
|
||||
@@ -81,6 +85,25 @@ function _generateJSDataStorageObject($calledPath, $calledMethod)
|
||||
echo $toPrint;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates global JS-Object to pass phrases to other javascripts
|
||||
*/
|
||||
function _generateJSPhrasesStorageObject($phrases)
|
||||
{
|
||||
$ci =& get_instance();
|
||||
$ci->load->library('PhrasesLib', array($phrases), 'pj');
|
||||
|
||||
$toPrint = "\n";
|
||||
$toPrint .= '<script type="text/javascript">';
|
||||
$toPrint .= "\n";
|
||||
$toPrint .= ' var FHC_JS_PHRASES_STORAGE_OBJECT = '.$ci->pj->getJSON().';';
|
||||
$toPrint .= "\n";
|
||||
$toPrint .= '</script>';
|
||||
$toPrint .= "\n\n";
|
||||
|
||||
echo $toPrint;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates tags for the javascripts you want to include, the parameter could by a string or an array of strings
|
||||
*/
|
||||
@@ -141,12 +164,15 @@ function _generateAddonsJSsInclude($calledFrom)
|
||||
// jQuery UI CSS
|
||||
if ($jqueryui === true) _generateCSSsInclude('vendor/components/jqueryui/themes/base/jquery-ui.min.css');
|
||||
|
||||
// bootstrap CSS
|
||||
// Bootstrap CSS
|
||||
if ($bootstrap === true) _generateCSSsInclude('vendor/twbs/bootstrap/dist/css/bootstrap.min.css');
|
||||
|
||||
// font awesome CSS
|
||||
// Font Awesome CSS
|
||||
if ($fontawesome === true) _generateCSSsInclude('vendor/components/font-awesome/css/font-awesome.min.css');
|
||||
|
||||
// AjaxLib CSS
|
||||
if ($ajaxlib === true) _generateCSSsInclude('public/css/AjaxLib.css');
|
||||
|
||||
// Table sorter CSS
|
||||
if ($tablesorter === true)
|
||||
{
|
||||
@@ -154,23 +180,34 @@ function _generateAddonsJSsInclude($calledFrom)
|
||||
_generateCSSsInclude('vendor/mottie/tablesorter/dist/css/jquery.tablesorter.pager.min.css');
|
||||
}
|
||||
|
||||
// sb admin template CSS
|
||||
// SB Admin 2 template CSS
|
||||
if ($sbadmintemplate === true)
|
||||
{
|
||||
_generateCSSsInclude('vendor/BlackrockDigital/startbootstrap-sb-admin-2/vendor/metisMenu/metisMenu.min.css');
|
||||
_generateCSSsInclude('vendor/BlackrockDigital/startbootstrap-sb-admin-2/dist/css/sb-admin-2.min.css');
|
||||
}
|
||||
|
||||
// FilterWidget CSS
|
||||
if ($filterwidget === true) _generateCSSsInclude('public/css/FilterWidget.css');
|
||||
|
||||
// NavigationWidget CSS
|
||||
if ($navigationwidget === true) _generateCSSsInclude('public/css/NavigationWidget.css');
|
||||
|
||||
// Eventually required CSS
|
||||
_generateCSSsInclude($customCSSs); // Eventually required CSS
|
||||
|
||||
|
||||
// --------------------------------------------------------------------------------------------------------
|
||||
// Javascripts
|
||||
|
||||
// Generates the global object to pass useful parms to the other javascripts
|
||||
// Generates the global object to pass useful parameters to other javascripts
|
||||
// NOTE: must be called before any other JS include
|
||||
_generateJSDataStorageObject($calledPath, $calledMethod);
|
||||
|
||||
// Generates the global object to pass phrases to javascripts
|
||||
// NOTE: must be called before including the PhrasesLib.js
|
||||
_generateJSPhrasesStorageObject($phrases);
|
||||
|
||||
// JQuery V3
|
||||
if ($jquery === true) _generateJSsInclude('vendor/components/jquery/jquery.min.js');
|
||||
|
||||
@@ -178,11 +215,10 @@ function _generateAddonsJSsInclude($calledFrom)
|
||||
if ($jqueryui === true)
|
||||
{
|
||||
_generateJSsInclude('vendor/components/jqueryui/jquery-ui.min.js');
|
||||
//datepicker german language file
|
||||
_generateJSsInclude('vendor/components/jqueryui/ui/i18n/datepicker-de.js');
|
||||
_generateJSsInclude('vendor/components/jqueryui/ui/i18n/datepicker-de.js'); // datepicker german language file
|
||||
}
|
||||
|
||||
// bootstrap JS
|
||||
// Bootstrap JS
|
||||
if ($bootstrap === true) _generateJSsInclude('vendor/twbs/bootstrap/dist/js/bootstrap.min.js');
|
||||
|
||||
// Table sorter JS
|
||||
@@ -193,16 +229,29 @@ function _generateAddonsJSsInclude($calledFrom)
|
||||
_generateJSsInclude('vendor/mottie/tablesorter/dist/js/extras/jquery.tablesorter.pager.min.js');
|
||||
}
|
||||
|
||||
//tinymce JS
|
||||
// Tinymce JS
|
||||
if($tinymce === true) _generateJSsInclude('vendor/tinymce/tinymce/tinymce.min.js') ;
|
||||
|
||||
// sb admin template JS
|
||||
// SB Admin 2 template JS
|
||||
if ($sbadmintemplate === true)
|
||||
{
|
||||
_generateJSsInclude('vendor/BlackrockDigital/startbootstrap-sb-admin-2/vendor/metisMenu/metisMenu.min.js');
|
||||
_generateJSsInclude('vendor/BlackrockDigital/startbootstrap-sb-admin-2/dist/js/sb-admin-2.min.js');
|
||||
}
|
||||
|
||||
// AjaxLib JS
|
||||
// NOTE: must be called before including others JS libraries that use it
|
||||
if ($ajaxlib === true) _generateJSsInclude('public/js/AjaxLib.js');
|
||||
|
||||
// PhrasesLib JS
|
||||
if ($phrases != null) _generateJSsInclude('public/js/PhrasesLib.js');
|
||||
|
||||
// FilterWidget JS
|
||||
if($filterwidget === true) _generateJSsInclude('public/js/FilterWidget.js') ;
|
||||
|
||||
// NavigationWidget JS
|
||||
if($navigationwidget === true) _generateJSsInclude('public/js/NavigationWidget.js') ;
|
||||
|
||||
// Load addon hooks JS
|
||||
if ($addons === true) _generateAddonsJSsInclude($calledPath.'/'.$calledMethod);
|
||||
|
||||
|
||||
@@ -1,190 +1,36 @@
|
||||
<style>
|
||||
|
||||
.filter-options-span {
|
||||
display: inline-block;
|
||||
width: 130px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.filter-name-title {
|
||||
font-family: inherit;
|
||||
font-size: 16px;
|
||||
/*font-weight: bold;*/
|
||||
line-height: 1.1;
|
||||
color: black;
|
||||
}
|
||||
|
||||
.filters-hidden-panel {
|
||||
margin: 0 10px 10px 10px;
|
||||
}
|
||||
|
||||
.hidden-control {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.filter-select-fields-dnd-div {
|
||||
height: 50px;
|
||||
}
|
||||
|
||||
.filter-select-field-dnd-span {
|
||||
border: 1px solid black;
|
||||
border-radius: 7px;
|
||||
margin-left: 3px;
|
||||
margin-right: 3px;
|
||||
padding: 10px;
|
||||
top: 10px;
|
||||
}
|
||||
|
||||
.filter-select-field-dnd-span:hover {
|
||||
cursor: move;
|
||||
}
|
||||
|
||||
.filter-select-field-dnd-span a {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.selection-before::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 100%;
|
||||
height: 100%;
|
||||
margin-right: 3px;
|
||||
border-left: 2px solid #428bca;
|
||||
}
|
||||
|
||||
.selection-after::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 100%;
|
||||
height: 100%;
|
||||
margin-left: 3px;
|
||||
border-right: 2px solid #428bca;
|
||||
}
|
||||
|
||||
.select-filter-operation {
|
||||
display: inline;
|
||||
width: 130px;
|
||||
}
|
||||
|
||||
.select-filter-operation-value {
|
||||
display: inline;
|
||||
width: 400px;
|
||||
}
|
||||
|
||||
.select-filter-option {
|
||||
display: inline;
|
||||
width: 100px;
|
||||
}
|
||||
|
||||
#addField, #customFilterDescription, #addFilter {
|
||||
display: inline;
|
||||
width: 535px;
|
||||
}
|
||||
|
||||
#selectedFilters {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
#applyFilter, #saveCustomFilterButton, .remove-selected-filter {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#applyFilter, #saveCustomFilterButton {
|
||||
width: 100px;
|
||||
}
|
||||
|
||||
.remove-selected-filter {
|
||||
padding-bottom: 3px;
|
||||
}
|
||||
|
||||
.panel-title {
|
||||
font-weight: bold;
|
||||
padding-top: 3px;
|
||||
}
|
||||
|
||||
.remove-field {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
</style>
|
||||
<script language="Javascript" type="text/javascript">
|
||||
|
||||
function sideMenuHook()
|
||||
{
|
||||
$(".remove-filter").click(function() {
|
||||
|
||||
$.ajax({
|
||||
url: "<?php echo site_url('system/Filters/deleteCustomFilter'); ?>",
|
||||
method: "POST",
|
||||
data: {
|
||||
filter_id: $(this).attr('value'),
|
||||
fhc_controller_id: getUrlParameter("fhc_controller_id")
|
||||
}
|
||||
})
|
||||
.done(function(data, textStatus, jqXHR) {
|
||||
|
||||
refreshSideMenu();
|
||||
|
||||
}).fail(function(jqXHR, textStatus, errorThrown) {
|
||||
alert(textStatus);
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
$("[data-toggle='collapse']").click(function() {
|
||||
|
||||
var filterOptionsStatus = sessionStorage.getItem('filter-options-status');
|
||||
|
||||
if (filterOptionsStatus != null && filterOptionsStatus == 'closed')
|
||||
{
|
||||
sessionStorage.setItem('filter-options-status', 'open');
|
||||
}
|
||||
else
|
||||
{
|
||||
sessionStorage.setItem('filter-options-status', 'closed');
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
var filterOptionsStatus = sessionStorage.getItem('filter-options-status');
|
||||
if (filterOptionsStatus != null && filterOptionsStatus == 'open')
|
||||
{
|
||||
$('.collapse').collapse("show");
|
||||
}
|
||||
|
||||
});
|
||||
</script>
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
|
||||
<?php FilterWidget::displayFilterName(); ?>
|
||||
<!-- Filter name -->
|
||||
<div class="filter-name-title"></div>
|
||||
|
||||
<br>
|
||||
|
||||
<!-- Filter options -->
|
||||
<div class="panel-group">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h4 class="panel-title">
|
||||
<a data-toggle="collapse" href="#collapseFilterHeader">Filter options</a>
|
||||
<a data-toggle="collapse" href="#collapseFilterHeader"><?php echo ucfirst($this->p->t('filter', 'filterEinstellungen')) ?></a>
|
||||
</h4>
|
||||
</div>
|
||||
<div id="collapseFilterHeader" class="panel-collapse collapse">
|
||||
<div class="filters-hidden-panel">
|
||||
<!-- Filter fields options -->
|
||||
<div>
|
||||
<?php FilterWidget::loadViewSelectFields(); ?>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
<!-- Filter filters options -->
|
||||
<div>
|
||||
<?php FilterWidget::loadViewSelectFilters(); ?>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
<!-- Filter save options -->
|
||||
<div>
|
||||
<?php FilterWidget::loadViewSaveFilter(); ?>
|
||||
</div>
|
||||
@@ -195,12 +41,15 @@
|
||||
|
||||
<br>
|
||||
|
||||
<!-- Filter info top -->
|
||||
<div id="datasetActionsTop"></div>
|
||||
|
||||
<!-- Filter table -->
|
||||
<div>
|
||||
<?php FilterWidget::loadViewTableDataset(); ?>
|
||||
</div>
|
||||
|
||||
<!-- Filter info bottom -->
|
||||
<div id="datasetActionsBottom"></div>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -1,48 +1,15 @@
|
||||
<script language="Javascript" type="text/javascript">
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
$("#saveCustomFilterButton").click(function() {
|
||||
if ($("#customFilterDescription").val() != '')
|
||||
{
|
||||
$.ajax({
|
||||
url: "<?php echo site_url('system/Filters/saveFilter'); ?>",
|
||||
method: "POST",
|
||||
data: {
|
||||
customFilterDescription: $("#customFilterDescription").val(),
|
||||
fhc_controller_id: getUrlParameter("fhc_controller_id")
|
||||
}
|
||||
})
|
||||
.done(function(data, textStatus, jqXHR) {
|
||||
|
||||
refreshSideMenu()
|
||||
|
||||
}).fail(function(jqXHR, textStatus, errorThrown) {
|
||||
alert(textStatus);
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
alert("Please fill te description of this filter");
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<br>
|
||||
|
||||
<div>
|
||||
<span class="filter-options-span">
|
||||
Filter description:
|
||||
<span class="filter-span-label">
|
||||
<?php echo ucfirst($this->p->t('global', 'beschreibung')); ?>:
|
||||
</span>
|
||||
<span>
|
||||
<input type="text" id="customFilterDescription" value="">
|
||||
<input type="text" id="customFilterDescription" class="input-text-custom-filter" value="">
|
||||
</span>
|
||||
|
||||
<span>
|
||||
<input type="button" id="saveCustomFilterButton" value="Save filter">
|
||||
<input type="button" id="saveCustomFilterButton" value="<?php echo ucfirst($this->p->t('ui', 'speichern')); ?>">
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1,247 +1,11 @@
|
||||
<script language="Javascript" type="text/javascript">
|
||||
<div id="dragAndDropFieldsArea" class="drag-and-drop-fields-area"></div>
|
||||
|
||||
function dndSF()
|
||||
{
|
||||
$(".filter-select-field-dnd-span").draggable({
|
||||
containment: "parent",
|
||||
cursor: "move",
|
||||
opacity: 0.4,
|
||||
revert: "invalid",
|
||||
revertDuration: 200,
|
||||
drag: function(event, ui) {
|
||||
<div>
|
||||
<span class="filter-span-label">
|
||||
<?php echo ucfirst($this->p->t('filter', 'feldHinzufuegen')); ?>:
|
||||
</span>
|
||||
|
||||
var padding = 20;
|
||||
var draggedElement = $(this);
|
||||
|
||||
$(".filter-select-field-dnd-span").each(function(i, e) {
|
||||
|
||||
if ($(this).attr('id') != draggedElement.attr('id'))
|
||||
{
|
||||
$(this).removeClass("selection-after");
|
||||
$(this).removeClass("selection-before");
|
||||
|
||||
var elementCenter = $(this).offset().left + ((padding + $(this).width()) / 2);
|
||||
|
||||
if (event.pageX > ($(this).offset().left - (padding / 2))
|
||||
&& event.pageX < ($(this).offset().left + $(this).width() + (padding / 2)))
|
||||
{
|
||||
if (event.pageX > elementCenter)
|
||||
{
|
||||
$(this).addClass("selection-after");
|
||||
$(this).removeClass("selection-before");
|
||||
}
|
||||
else if (event.pageX < elementCenter)
|
||||
{
|
||||
$(this).addClass("selection-before");
|
||||
$(this).removeClass("selection-after");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
$(".filter-select-field-dnd-span").droppable({
|
||||
accept: ".filter-select-field-dnd-span",
|
||||
drop: function(event, ui) {
|
||||
|
||||
var padding = 20;
|
||||
var elementCenter = $(this).offset().left + ((padding + $(this).width()) / 2);
|
||||
var draggedElement = ui.helper;
|
||||
|
||||
if (event.pageX > elementCenter)
|
||||
{
|
||||
draggedElement.insertAfter($(this));
|
||||
}
|
||||
else if (event.pageX < elementCenter)
|
||||
{
|
||||
draggedElement.insertBefore($(this));
|
||||
}
|
||||
|
||||
$(this).removeClass("selection-before");
|
||||
$(this).removeClass("selection-after");
|
||||
|
||||
draggedElement.css({left: '0px', top: '10px'});
|
||||
|
||||
var arrayDndId = [];
|
||||
|
||||
$(".filter-select-field-dnd-span").each(function(i, e) {
|
||||
|
||||
arrayDndId[i] = $(this).attr('id').replace('dnd', '');
|
||||
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
url: "<?php echo site_url('system/Filters/sortSelectedFields'); ?>",
|
||||
method: "POST",
|
||||
data: {
|
||||
selectedFieldsLst: arrayDndId,
|
||||
fhc_controller_id: getUrlParameter("fhc_controller_id")
|
||||
}
|
||||
})
|
||||
.done(function(data, textStatus, jqXHR) {
|
||||
|
||||
resetSelectedFields();
|
||||
renderSelectedFields();
|
||||
|
||||
renderTableDataset();
|
||||
|
||||
}).fail(function(jqXHR, textStatus, errorThrown) {
|
||||
alert(textStatus);
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function resetEventsSF()
|
||||
{
|
||||
$("#addField").off('change');
|
||||
$(".remove-field").off('click');
|
||||
}
|
||||
|
||||
function addEventsSF()
|
||||
{
|
||||
$("#addField").change(function(event) {
|
||||
|
||||
$.ajax({
|
||||
url: "<?php echo site_url('system/Filters/addSelectedFields'); ?>",
|
||||
method: "POST",
|
||||
data: {
|
||||
fieldName: $(this).val(),
|
||||
fhc_controller_id: getUrlParameter("fhc_controller_id")
|
||||
}
|
||||
})
|
||||
.done(function(data, textStatus, jqXHR) {
|
||||
|
||||
resetSelectedFields();
|
||||
renderSelectedFields();
|
||||
|
||||
renderTableDataset();
|
||||
|
||||
}).fail(function(jqXHR, textStatus, errorThrown) {
|
||||
alert(textStatus);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$(".remove-field").click(function(event) {
|
||||
|
||||
$.ajax({
|
||||
url: "<?php echo site_url('system/Filters/removeSelectedFields'); ?>",
|
||||
method: "POST",
|
||||
data: {
|
||||
fieldName: $(this).attr('fieldToRemove'),
|
||||
fhc_controller_id: getUrlParameter("fhc_controller_id")
|
||||
}
|
||||
})
|
||||
.done(function(data, textStatus, jqXHR) {
|
||||
|
||||
resetSelectedFields();
|
||||
renderSelectedFields();
|
||||
|
||||
renderTableDataset();
|
||||
|
||||
}).fail(function(jqXHR, textStatus, errorThrown) {
|
||||
alert(textStatus);
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
function renderSelectedFields()
|
||||
{
|
||||
$.ajax({
|
||||
url: "<?php echo site_url('system/Filters/selectFields'); ?>",
|
||||
method: "GET",
|
||||
data: {
|
||||
fhc_controller_id: getUrlParameter("fhc_controller_id")
|
||||
},
|
||||
dataType: "json"
|
||||
})
|
||||
.done(function(data, textStatus, jqXHR) {
|
||||
|
||||
resetEventsSF();
|
||||
|
||||
if (data != null)
|
||||
{
|
||||
var arrayFieldsToDisplay = [];
|
||||
|
||||
if (data.columnsAliases != null && $.isArray(data.columnsAliases))
|
||||
{
|
||||
arrayFieldsToDisplay = data.columnsAliases;
|
||||
}
|
||||
else if (data.selectedFields != null && $.isArray(data.selectedFields))
|
||||
{
|
||||
arrayFieldsToDisplay = data.selectedFields;
|
||||
}
|
||||
|
||||
for (var i = 0; i < arrayFieldsToDisplay.length; i++)
|
||||
{
|
||||
var fieldToDisplay = arrayFieldsToDisplay[i];
|
||||
var fieldName = data.selectedFields[i];
|
||||
|
||||
var strHtml = '<span id="dnd' + fieldName + '" class="filter-select-field-dnd-span">';
|
||||
|
||||
strHtml += '<span>';
|
||||
strHtml += fieldToDisplay;
|
||||
strHtml += '</span>';
|
||||
strHtml += '<span><a class="remove-field" fieldToRemove="' + fieldName + '"> X </a></span>';
|
||||
strHtml += '</span>';
|
||||
$("#filterSelectFieldsDnd").append(strHtml);
|
||||
}
|
||||
|
||||
var strDropDown = '<option value="">Select a field to add...</option>';
|
||||
$("#addField").append(strDropDown);
|
||||
|
||||
for (var i = 0; i < data.allSelectedFields.length; i++)
|
||||
{
|
||||
var fieldName = data.allSelectedFields[i];
|
||||
var fieldToDisplay = data.allSelectedFields[i];
|
||||
|
||||
if (data.selectedFields.indexOf(fieldName) < 0)
|
||||
{
|
||||
if (data.allColumnsAliases != null && $.isArray(data.allColumnsAliases))
|
||||
{
|
||||
fieldToDisplay = data.allColumnsAliases[i];
|
||||
}
|
||||
|
||||
strDropDown = '<option value="' + fieldName + '">' + fieldToDisplay + '</option>';
|
||||
$("#addField").append(strDropDown);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dndSF();
|
||||
addEventsSF();
|
||||
})
|
||||
.fail(function(jqXHR, textStatus, errorThrown) {
|
||||
alert(textStatus);
|
||||
});
|
||||
}
|
||||
|
||||
function resetSelectedFields()
|
||||
{
|
||||
$("#filterSelectFieldsDnd").html("");
|
||||
$("#addField").html("");
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
renderSelectedFields();
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<div id="filterSelectFieldsDnd" class="filter-select-fields-dnd-div"></div>
|
||||
|
||||
<div>
|
||||
<span class="filter-options-span">
|
||||
Add field:
|
||||
</span>
|
||||
|
||||
<span>
|
||||
<select id="addField"></select>
|
||||
</span>
|
||||
</div>
|
||||
<span>
|
||||
<select id="addField" class="drop-down-fields"></select>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -1,296 +1,17 @@
|
||||
<script language="Javascript" type="text/javascript">
|
||||
|
||||
function resetEventsSFilters()
|
||||
{
|
||||
$("#addFilter").off('change');
|
||||
}
|
||||
|
||||
function addEventsSFilters()
|
||||
{
|
||||
$("#addFilter").change(function(event) {
|
||||
|
||||
$.ajax({
|
||||
url: "<?php echo site_url('system/Filters/addSelectedFilters'); ?>",
|
||||
method: "POST",
|
||||
data: {
|
||||
fieldName: $(this).val(),
|
||||
fhc_controller_id: getUrlParameter("fhc_controller_id")
|
||||
}
|
||||
})
|
||||
.done(function(data, textStatus, jqXHR) {
|
||||
|
||||
resetSelectedFilters();
|
||||
renderSelectedFilters();
|
||||
|
||||
renderTableDataset();
|
||||
|
||||
}).fail(function(jqXHR, textStatus, errorThrown) {
|
||||
alert(textStatus);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$(".select-filter-operation").change(function() {
|
||||
|
||||
if ($(this).val() == "set" || $(this).val() == "nset")
|
||||
{
|
||||
$(this).parent().parent().find(".select-filter-operation-value").addClass("hidden-control");
|
||||
$(this).parent().parent().find(".select-filter-option").addClass("hidden-control");
|
||||
|
||||
$(this).parent().parent().find(".select-filter-operation-value").prop('disabled', true);
|
||||
$(this).parent().parent().find(".select-filter-option").prop('disabled', true);
|
||||
}
|
||||
else
|
||||
{
|
||||
$(this).parent().parent().find(".select-filter-operation-value").removeClass("hidden-control");
|
||||
$(this).parent().parent().find(".select-filter-option").removeClass("hidden-control");
|
||||
|
||||
$(this).parent().parent().find(".select-filter-operation-value").prop('disabled', false);
|
||||
$(this).parent().parent().find(".select-filter-option").prop('disabled', false);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$("#applyFilter").click(function() {
|
||||
|
||||
var selectFilterName = [];
|
||||
var selectFilterOperation = [];
|
||||
var selectFilterOperationValue = [];
|
||||
var selectFilterOption = [];
|
||||
|
||||
$("#selectedFilters > div").each(function(i, e) {
|
||||
var tmpSelectFilterName = $(this).find('.hidden-field-name').val();
|
||||
var tmpSelectFilterOperation = $(this).find('.select-filter-operation').val();
|
||||
var tmpSelectFilterOperationValue = $(this).find('.select-filter-operation-value:enabled').val();
|
||||
var tmpSelectFilterOption = $(this).find('.select-filter-option:enabled').val();
|
||||
|
||||
selectFilterName.push(tmpSelectFilterName);
|
||||
selectFilterOperation.push(tmpSelectFilterOperation);
|
||||
selectFilterOperationValue.push(tmpSelectFilterOperationValue != null ? tmpSelectFilterOperationValue : "");
|
||||
selectFilterOption.push(tmpSelectFilterOption != null ? tmpSelectFilterOption : "");
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
url: "<?php echo site_url('system/Filters/applyFilter'); ?>",
|
||||
method: "POST",
|
||||
data: {
|
||||
filterNames: selectFilterName,
|
||||
filterOperations: selectFilterOperation,
|
||||
filterOperationValues: selectFilterOperationValue,
|
||||
filterOptions: selectFilterOption,
|
||||
fhc_controller_id: getUrlParameter("fhc_controller_id")
|
||||
}
|
||||
})
|
||||
.done(function(data, textStatus, jqXHR) {
|
||||
|
||||
// Success
|
||||
|
||||
}).fail(function(jqXHR, textStatus, errorThrown) {
|
||||
|
||||
// Error
|
||||
|
||||
}).always(function() {
|
||||
|
||||
location.reload();
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$(".remove-selected-filter").click(function(event) {
|
||||
$.ajax({
|
||||
url: "<?php echo site_url('system/Filters/removeSelectedFilters'); ?>",
|
||||
method: "POST",
|
||||
data: {
|
||||
fieldName: $(this).attr('filterToRemove'),
|
||||
fhc_controller_id: getUrlParameter("fhc_controller_id")
|
||||
}
|
||||
})
|
||||
.done(function(data, textStatus, jqXHR) {
|
||||
resetSelectedFilters();
|
||||
renderSelectedFilters();
|
||||
}).fail(function(jqXHR, textStatus, errorThrown) {
|
||||
alert(textStatus);
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function renderSelectedFilterFields(metaData, activeFilters, activeFiltersOperation, activeFiltersOption)
|
||||
{
|
||||
var html = '';
|
||||
|
||||
if (metaData.type.toLowerCase().indexOf("int") >= 0)
|
||||
{
|
||||
html = '<span>';
|
||||
html += ' <select class="form-control select-filter-operation">';
|
||||
html += ' <option value="equal" ' + (activeFiltersOperation == "equal" ? "selected" : "") + '>equal</option>';
|
||||
html += ' <option value="nequal" ' + (activeFiltersOperation == "nqual" ? "selected" : "") + '>not equal</option>';
|
||||
html += ' <option value="gt" ' + (activeFiltersOperation == "gt" ? "selected" : "") + '>greater than</option>';
|
||||
html += ' <option value="lt" ' + (activeFiltersOperation == "lt" ? "selected" : "") + '>less than</option>';
|
||||
html += ' </select>';
|
||||
html += '</span>';
|
||||
html += '<span>';
|
||||
html += ' <input type="number" value="' + activeFilters + '" class="form-control select-filter-operation-value">';
|
||||
html += '</span>';
|
||||
}
|
||||
if (metaData.type.toLowerCase().indexOf('varchar') >= 0 || metaData.type.toLowerCase() == 'text')
|
||||
{
|
||||
html = '<span>';
|
||||
html += ' <select class="form-control select-filter-operation">';
|
||||
html += ' <option value="contains" ' + (activeFiltersOperation == "contains" ? "selected" : "") + '>contains</option>';
|
||||
html += ' <option value="ncontains" ' + (activeFiltersOperation == "ncontains" ? "selected" : "") + '>does not contain</option>';
|
||||
html += ' </select>';
|
||||
html += '</span>';
|
||||
html += '<span>';
|
||||
html += ' <input type="text" value="' + activeFilters + '" class="form-control select-filter-operation-value">';
|
||||
html += '</span>';
|
||||
}
|
||||
if (metaData.type.toLowerCase().indexOf('bool') >= 0)
|
||||
{
|
||||
html = '<span>';
|
||||
html += ' <select class="form-control select-filter-operation">';
|
||||
html += ' <option value="true" ' + (activeFiltersOperation == "true" ? "selected" : "") + '>is true</option>';
|
||||
html += ' <option value="false" ' + (activeFiltersOperation == "false" ? "selected" : "") + '>is false</option>';
|
||||
html += ' </select>';
|
||||
html += '</span>';
|
||||
html += '<span>';
|
||||
html += ' <input type="hidden" value="' + activeFilters + '" class="form-control select-filter-operation-value">';
|
||||
html += '</span>';
|
||||
}
|
||||
if (metaData.type.toLowerCase().indexOf('timestamp') >= 0 || metaData.type.toLowerCase().indexOf('date') >= 0)
|
||||
{
|
||||
var classOperation = 'form-control select-filter-operation-value';
|
||||
var classOption = 'form-control select-filter-option';
|
||||
var disabled = "";
|
||||
|
||||
if (activeFiltersOperation == "set" || activeFiltersOperation == "nset")
|
||||
{
|
||||
classOperation += ' hidden-control';
|
||||
classOption += ' hidden-control';
|
||||
disabled = "disabled";
|
||||
}
|
||||
|
||||
html = '<span>';
|
||||
html += ' <select class="form-control select-filter-operation">';
|
||||
html += ' <option value="lt" ' + (activeFiltersOperation == "lt" ? "selected" : "") + '>less than</option>';
|
||||
html += ' <option value="gt" ' + (activeFiltersOperation == "gt" ? "selected" : "") + '>greater than</option>';
|
||||
html += ' <option value="set" ' + (activeFiltersOperation == "set" ? "selected" : "") + '>is set</option>';
|
||||
html += ' <option value="nset" ' + (activeFiltersOperation == "nset" ? "selected" : "") + '>is not set</option>';
|
||||
html += ' </select>';
|
||||
html += '</span>';
|
||||
html += '<span>';
|
||||
html += ' <input type="text" value="' + activeFilters + '" class="' + classOperation + '" ' + disabled + '>';
|
||||
html += '</span>';
|
||||
html += '<span>';
|
||||
html += ' <select class="' + classOption + '" ' + disabled + '>';
|
||||
html += ' <option value="days" ' + (activeFiltersOption == "days" ? "selected" : "") + '>Days</option>';
|
||||
html += ' <option value="months" ' + (activeFiltersOption == "months" ? "selected" : "") + '>Months</option>';
|
||||
html += ' </select>';
|
||||
html += '</span>';
|
||||
}
|
||||
|
||||
html += '<span>';
|
||||
html += ' <input type="hidden" value="' + metaData.name + '" class="hidden-field-name">';
|
||||
html += '</span>';
|
||||
|
||||
return html;
|
||||
}
|
||||
|
||||
function renderSelectedFilters()
|
||||
{
|
||||
$.ajax({
|
||||
url: "<?php echo site_url('system/Filters/selectFilters'); ?>",
|
||||
method: "GET",
|
||||
data: {
|
||||
fhc_controller_id: getUrlParameter("fhc_controller_id")
|
||||
},
|
||||
dataType: "json"
|
||||
})
|
||||
.done(function(data, textStatus, jqXHR) {
|
||||
|
||||
resetEventsSFilters();
|
||||
|
||||
if (data != null)
|
||||
{
|
||||
var strDropDown = '<option value="">Select a filter to add...</option>';
|
||||
$("#addFilter").append(strDropDown);
|
||||
|
||||
for (var i = 0; i < data.selectedFilters.length; i++)
|
||||
{
|
||||
var selectedFilters = '<div>';
|
||||
|
||||
selectedFilters += '<span class="filter-options-span">';
|
||||
selectedFilters += data.selectedFiltersAliases[i];
|
||||
selectedFilters += '</span>';
|
||||
|
||||
selectedFilters += renderSelectedFilterFields(
|
||||
data.selectedFiltersMetaData[i],
|
||||
data.selectedFiltersActiveFilters[i],
|
||||
data.selectedFiltersActiveFiltersOperation[i],
|
||||
data.selectedFiltersActiveFiltersOption[i]
|
||||
);
|
||||
|
||||
selectedFilters += '<span>';
|
||||
selectedFilters += '<input type="button" value="X" class="remove-selected-filter btn btn-default" filterToRemove="' + data.selectedFilters[i] + '">';
|
||||
selectedFilters += '</span>';
|
||||
|
||||
selectedFilters += '</div>';
|
||||
|
||||
$("#selectedFilters").append(selectedFilters);
|
||||
}
|
||||
|
||||
for (var i = 0; i < data.allSelectedFields.length; i++)
|
||||
{
|
||||
var fieldName = data.allSelectedFields[i];
|
||||
var fieldToDisplay = data.allSelectedFields[i];
|
||||
|
||||
if (data.selectedFilters.indexOf(fieldName) < 0)
|
||||
{
|
||||
if (data.allColumnsAliases != null && $.isArray(data.allColumnsAliases))
|
||||
{
|
||||
fieldToDisplay = data.allColumnsAliases[i];
|
||||
}
|
||||
|
||||
strDropDown = '<option value="' + fieldName + '">' + fieldToDisplay + '</option>';
|
||||
$("#addFilter").append(strDropDown);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
addEventsSFilters();
|
||||
})
|
||||
.fail(function(jqXHR, textStatus, errorThrown) {
|
||||
alert(textStatus);
|
||||
});
|
||||
}
|
||||
|
||||
function resetSelectedFilters()
|
||||
{
|
||||
$("#addFilter").html("");
|
||||
$("#selectedFilters").html("");
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
renderSelectedFilters();
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<br>
|
||||
|
||||
<div id="selectedFilters"></div>
|
||||
<div id="appliedFilters"></div>
|
||||
|
||||
<div>
|
||||
<span class="filter-options-span">
|
||||
Add filter:
|
||||
<span class="filter-span-label">
|
||||
<?php echo ucfirst($this->p->t('filter', 'filterHinzufuegen')); ?>:
|
||||
</span>
|
||||
|
||||
<span>
|
||||
<select id="addFilter"></select>
|
||||
<select id="addFilter" class="drop-down-filters"></select>
|
||||
</span>
|
||||
|
||||
<span>
|
||||
<input id="applyFilter" type="button" value="Apply filter">
|
||||
<input id="applyFilter" type="button" value="<?php echo ucfirst($this->p->t('global', 'hinzufuegen')); ?>">
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -1,153 +1,3 @@
|
||||
<script language="Javascript" type="text/javascript">
|
||||
|
||||
function callTableSorter()
|
||||
{
|
||||
// Checks if the table contains data (rows)
|
||||
if ($('#filterTableDataset').find('tbody:empty').length == 0
|
||||
&& $('#filterTableDataset').find('tr:empty').length == 0
|
||||
&& $('#filterTableDataset').hasClass('table-condensed'))
|
||||
{
|
||||
$("#filterTableDataset").tablesorter({
|
||||
widgets: ["zebra", "filter"]
|
||||
});
|
||||
|
||||
var config = $('#filterTableDataset')[0].config;
|
||||
$.tablesorter.updateAll(config, true, null);
|
||||
}
|
||||
}
|
||||
|
||||
function renderTableDataset()
|
||||
{
|
||||
$.ajax({
|
||||
url: "<?php echo site_url('system/Filters/tableDataset'); ?>",
|
||||
method: "GET",
|
||||
data: {
|
||||
fhc_controller_id: getUrlParameter("fhc_controller_id")
|
||||
},
|
||||
dataType: "json"
|
||||
})
|
||||
.done(function(data, textStatus, jqXHR) {
|
||||
|
||||
resetTableDataset();
|
||||
|
||||
if (data != null)
|
||||
{
|
||||
if (data.checkboxes != null)
|
||||
{
|
||||
$("#filterTableDataset > thead > tr").append("<th title=\"Select\">Select</th>");
|
||||
}
|
||||
|
||||
var arrayFieldsToDisplay = [];
|
||||
|
||||
if (data.columnsAliases != null && $.isArray(data.columnsAliases) && data.columnsAliases.length > 0)
|
||||
{
|
||||
arrayFieldsToDisplay = data.columnsAliases;
|
||||
}
|
||||
else if (data.selectedFields != null && $.isArray(data.selectedFields))
|
||||
{
|
||||
arrayFieldsToDisplay = data.selectedFields;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------ */
|
||||
if (data.checkboxes != null && data.checkboxes != "")
|
||||
{
|
||||
$("#filterTableDataset > thead > tr").html("<th title=\"Select\">Select</th>");
|
||||
}
|
||||
|
||||
for (var i = 0; i < arrayFieldsToDisplay.length; i++)
|
||||
{
|
||||
var th = arrayFieldsToDisplay[i];
|
||||
|
||||
$("#filterTableDataset > thead > tr").append("<th title=\"" + th + "\">" + th + "</th>");
|
||||
}
|
||||
|
||||
if (data.additionalColumns != null && $.isArray(data.additionalColumns))
|
||||
{
|
||||
for (var i = 0; i < data.additionalColumns.length; i++)
|
||||
{
|
||||
var th = data.additionalColumns[i];
|
||||
|
||||
$("#filterTableDataset > thead > tr").append("<th title=\"" + th + "\">" + th + "</th>");
|
||||
}
|
||||
}
|
||||
/* ------------------------------------------------------------------------------------------------ */
|
||||
|
||||
if (arrayFieldsToDisplay.length > 0)
|
||||
{
|
||||
if (data.dataset != null && $.isArray(data.dataset))
|
||||
{
|
||||
for (var i = 0; i < data.dataset.length; i++)
|
||||
{
|
||||
var record = data.dataset[i];
|
||||
var strHtml = '<tr class="' + record.FILTER_CLASS_MARK_ROW + '">';
|
||||
|
||||
if (data.checkboxes != null && data.checkboxes != "")
|
||||
{
|
||||
strHtml += '<td>';
|
||||
strHtml += '<input type="checkbox" name="' + data.checkboxes + '[]" value="' + record[data.checkboxes] + '">';
|
||||
strHtml += '</td>';
|
||||
}
|
||||
|
||||
$.each(arrayFieldsToDisplay, function(i, fieldToDisplay) {
|
||||
|
||||
if (record.hasOwnProperty(data.selectedFields[i]))
|
||||
{
|
||||
strHtml += '<td>' + record[data.selectedFields[i]] + '</td>';
|
||||
}
|
||||
});
|
||||
|
||||
if (data.additionalColumns != null && $.isArray(data.additionalColumns))
|
||||
{
|
||||
$.each(data.additionalColumns, function(i, additionalColumn) {
|
||||
|
||||
if (record.hasOwnProperty(additionalColumn))
|
||||
{
|
||||
strHtml += '<td>' + record[additionalColumn] + '</td>';
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
strHtml += '</tr>';
|
||||
|
||||
$("#filterTableDataset > tbody").append(strHtml);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// console.log("No dataset!!!");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
console.log("No fields to display!!!");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
console.log("No data!!!");
|
||||
}
|
||||
|
||||
callTableSorter();
|
||||
|
||||
})
|
||||
.fail(function(jqXHR, textStatus, errorThrown) {
|
||||
alert(textStatus);
|
||||
});
|
||||
}
|
||||
|
||||
function resetTableDataset()
|
||||
{
|
||||
$("#filterTableDataset > thead > tr").html("");
|
||||
$("#filterTableDataset > tbody").html("");
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
renderTableDataset();
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<div>
|
||||
<table class="tablesorter table-bordered table-responsive" id="filterTableDataset">
|
||||
<thead>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<nav class="navbar navbar-default navbar-static-top" role="navigation" style="margin-bottom: 0">
|
||||
<?php
|
||||
// Header
|
||||
echo $this->widgetlib->widget('NavigationHeaderWidget');
|
||||
<nav class="navbar navbar-default navbar-static-top" role="navigation" style="margin-bottom: 0">
|
||||
<?php
|
||||
// Header
|
||||
echo $this->widgetlib->widget('NavigationHeaderWidget');
|
||||
|
||||
// Left menu
|
||||
echo $this->widgetlib->widget('NavigationMenuWidget');
|
||||
?>
|
||||
</nav>
|
||||
// Left menu
|
||||
echo $this->widgetlib->widget('NavigationMenuWidget');
|
||||
?>
|
||||
</nav>
|
||||
|
||||
@@ -1,39 +1,11 @@
|
||||
<script language="Javascript" type="text/javascript">
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
$.ajax({
|
||||
url: "<?php echo site_url('system/Navigation/header'); ?>",
|
||||
method: "GET",
|
||||
data: {
|
||||
navigation_widget_called: "<?php echo $this->router->directory.$this->router->class.'/'.$this->router->method; ?>"
|
||||
}
|
||||
})
|
||||
.done(function(data, textStatus, jqXHR) {
|
||||
|
||||
if (data != null)
|
||||
{
|
||||
jQuery.each(data, function(i, e) {
|
||||
$(".menu-header-items").append('<a class="navbar-brand" href="' + e + '">' + i + '</a>');
|
||||
});
|
||||
}
|
||||
|
||||
}).fail(function(jqXHR, textStatus, errorThrown) {
|
||||
alert(textStatus);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<div class="navbar-header">
|
||||
<span>
|
||||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
|
||||
<span class="sr-only">Menü umschalten </span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
</span>
|
||||
<span class="menu-header-items"></span>
|
||||
</div>
|
||||
<div class="navbar-header">
|
||||
<span>
|
||||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
|
||||
<span class="sr-only">Menü umschalten </span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
</span>
|
||||
<span class="menu-header-items"></span>
|
||||
</div>
|
||||
|
||||
@@ -1,169 +1,3 @@
|
||||
<style>
|
||||
#collapseinicon {
|
||||
display: none;
|
||||
cursor: pointer;
|
||||
color: #337ab7;
|
||||
border-bottom: 1px solid #e7e7e7;
|
||||
border-right: 1px solid #e7e7e7;
|
||||
border-left: 1px solid #e7e7e7;
|
||||
position: absolute;
|
||||
width: 45px;
|
||||
height: 20px;
|
||||
background-color: #F8F8F8;
|
||||
}
|
||||
|
||||
.nav > li > span > a:focus, .nav > li > span > a:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.nav > li > span {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
padding-top: 15px;
|
||||
padding-bottom: 15px;
|
||||
}
|
||||
|
||||
.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 language="Javascript" type="text/javascript">
|
||||
|
||||
function printNavItem(item, depth = 1)
|
||||
{
|
||||
strMenu = "";
|
||||
var expanded = typeof item['expand'] != 'undefined' && item['expand'] === true ? ' active' : '';
|
||||
|
||||
strMenu += '<li class="' + expanded + '">';
|
||||
|
||||
if (typeof item['subscriptLinkClass'] != 'undefined' && typeof item['subscriptDescription'] != 'undefined')
|
||||
{
|
||||
strMenu += '<span>';
|
||||
}
|
||||
|
||||
strMenu += '<a href="' + item['link'] + '"' + expanded + '>';
|
||||
|
||||
if (item['icon'] != 'undefined')
|
||||
{
|
||||
strMenu += '<i class="fa fa-' + item['icon'] + ' fa-fw"></i> ';
|
||||
}
|
||||
|
||||
strMenu += item['description'];
|
||||
|
||||
if (typeof item['children'] != 'undefined' && Object.keys(item['children']).length > 0)
|
||||
{
|
||||
strMenu += '<span class="fa arrow"></span>';
|
||||
}
|
||||
|
||||
strMenu += '</a>';
|
||||
|
||||
if (typeof item['subscriptLinkClass'] != 'undefined' && typeof item['subscriptDescription'] != 'undefined')
|
||||
{
|
||||
strMenu += '<a class="' + item['subscriptLinkClass'] + ' menuSubscriptLink" value="' + item['subscriptLinkValue'] + '" href="#"> (' + item['subscriptDescription'] + ')</a>';
|
||||
strMenu += '</span>';
|
||||
}
|
||||
|
||||
if (typeof item['children'] != 'undefined' && Object.keys(item['children']).length > 0)
|
||||
{
|
||||
var level = '';
|
||||
if (depth === 1)
|
||||
{
|
||||
level = 'second';
|
||||
}
|
||||
else if (depth > 1)
|
||||
{
|
||||
level = 'third';
|
||||
}
|
||||
|
||||
strMenu += '<ul class="nav nav-' + level + '-level" ' + expanded + '>';
|
||||
|
||||
jQuery.each(item['children'], function(i, e) {
|
||||
strMenu += printNavItem(e, ++depth);
|
||||
});
|
||||
|
||||
strMenu += '</ul>';
|
||||
}
|
||||
|
||||
strMenu += '</li>';
|
||||
|
||||
return strMenu;
|
||||
}
|
||||
|
||||
function renderSideMenu()
|
||||
{
|
||||
$.ajax({
|
||||
url: "<?php echo site_url('system/Navigation/menu'); ?>",
|
||||
method: "GET",
|
||||
data: {
|
||||
navigation_widget_called: "<?php echo $this->router->directory.$this->router->class.'/'.$this->router->method; ?>"
|
||||
}
|
||||
})
|
||||
.done(function(data, textStatus, jqXHR) {
|
||||
|
||||
if (data != null)
|
||||
{
|
||||
var strMenu = '';
|
||||
|
||||
printCollapseIcon();
|
||||
|
||||
jQuery.each(data, function(i, e) {
|
||||
strMenu += printNavItem(e);
|
||||
});
|
||||
|
||||
$("#side-menu").html(strMenu);
|
||||
$("#side-menu").metisMenu();
|
||||
}
|
||||
|
||||
if (typeof sideMenuHook == 'function')
|
||||
{
|
||||
sideMenuHook();
|
||||
}
|
||||
|
||||
}).fail(function(jqXHR, textStatus, errorThrown) {
|
||||
alert(textStatus);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function printCollapseIcon()
|
||||
{
|
||||
// Hiding/showing navigation menu - works only with sb admin 2 template!!
|
||||
if(!$("#collapseicon").length)
|
||||
$("#side-menu").parent().append('<div id="collapseicon" title="hide Menu" class="text-right" style="cursor: pointer; color: #337ab7"><i class="fa fa-angle-double-left fa-fw"></i></div>');
|
||||
|
||||
$("#collapseicon").click(function() {
|
||||
$("#page-wrapper").css('margin-left', '0px');
|
||||
$("#side-menu").hide();
|
||||
$("#collapseicon").hide();
|
||||
$("#collapseinicon").show();
|
||||
});
|
||||
|
||||
$("#collapseinicon").click(function() {
|
||||
$("#page-wrapper").css('margin-left', '250px');
|
||||
$("#side-menu").show();
|
||||
$("#collapseicon").show();
|
||||
$("#collapseinicon").hide();
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
renderSideMenu();
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<div class="navbar-default sidebar" role="navigation">
|
||||
<div class="sidebar-nav navbar-collapse">
|
||||
<ul class="nav" id="side-menu"></ul>
|
||||
|
||||
+359
-1099
File diff suppressed because it is too large
Load Diff
@@ -1,22 +1,21 @@
|
||||
<?php
|
||||
|
||||
class Nation_widget extends DropdownWidget
|
||||
{
|
||||
public function display($widgetData)
|
||||
{
|
||||
// Nation
|
||||
$this->load->model('codex/nation_model', 'NationModel');
|
||||
$this->NationModel->addOrder('nation_code');
|
||||
|
||||
$this->addSelectToModel($this->NationModel, 'nation_code', 'kurztext');
|
||||
|
||||
$this->setElementsArray(
|
||||
$this->NationModel->load(),
|
||||
true,
|
||||
'Nation wählen...',
|
||||
'keine Nation gefunden'
|
||||
);
|
||||
|
||||
$this->loadDropDownView($widgetData);
|
||||
}
|
||||
<?php
|
||||
|
||||
class Nation_widget extends DropdownWidget
|
||||
{
|
||||
public function display($widgetData)
|
||||
{
|
||||
// Nation
|
||||
$this->load->model('codex/nation_model', 'NationModel');
|
||||
$this->NationModel->addOrder('nation_code');
|
||||
|
||||
$this->addSelectToModel($this->NationModel, 'nation_code', 'kurztext');
|
||||
|
||||
$this->setElementsArray(
|
||||
$this->NationModel->load(),
|
||||
true,
|
||||
$this->p->t('ui', 'bitteEintragWaehlen')
|
||||
);
|
||||
|
||||
$this->loadDropDownView($widgetData);
|
||||
}
|
||||
}
|
||||
@@ -27,8 +27,7 @@ class Vorlage_widget extends DropdownWidget
|
||||
$this->setElementsArray(
|
||||
$vorlage,
|
||||
true,
|
||||
'Select a vorlage...',
|
||||
'No vorlage found'
|
||||
$this->p->t('ui', 'vorlageWaehlen')
|
||||
);
|
||||
|
||||
$this->loadDropDownView($widgetData);
|
||||
|
||||
@@ -1,22 +1,21 @@
|
||||
<?php
|
||||
|
||||
class Zgv_widget extends DropdownWidget
|
||||
{
|
||||
public function display($widgetData)
|
||||
{
|
||||
// Zgv
|
||||
$this->load->model('codex/zgv_model', 'ZgvModel');
|
||||
$this->ZgvModel->addOrder('zgv_bez');
|
||||
|
||||
$this->addSelectToModel($this->ZgvModel, 'zgv_code', 'zgv_bez');
|
||||
|
||||
$this->setElementsArray(
|
||||
$this->ZgvModel->load(),
|
||||
true,
|
||||
'Zgv wählen...',
|
||||
'keine Zgv gefunden'
|
||||
);
|
||||
|
||||
$this->loadDropDownView($widgetData);
|
||||
}
|
||||
<?php
|
||||
|
||||
class Zgv_widget extends DropdownWidget
|
||||
{
|
||||
public function display($widgetData)
|
||||
{
|
||||
// Zgv
|
||||
$this->load->model('codex/zgv_model', 'ZgvModel');
|
||||
$this->ZgvModel->addOrder('zgv_bez');
|
||||
|
||||
$this->addSelectToModel($this->ZgvModel, 'zgv_code', 'zgv_bez');
|
||||
|
||||
$this->setElementsArray(
|
||||
$this->ZgvModel->load(),
|
||||
true,
|
||||
$this->p->t('ui', 'bitteEintragWaehlen')
|
||||
);
|
||||
|
||||
$this->loadDropDownView($widgetData);
|
||||
}
|
||||
}
|
||||
@@ -370,14 +370,12 @@ function writePruefungsTable(e, data, anmeldung)
|
||||
{
|
||||
if(storno)
|
||||
{
|
||||
//button = "<p><span style='display: inline-block; width: 155px;'>Stornieren (bis "+frist+"): </span><input style='width: 90px;' type='button' value='"+termin+"' onclick='stornoAnmeldung(\""+anmeldung_id+"\");'></br>";
|
||||
button = "<p><a href='#' title='<?php echo $p->t('pruefung/stornierenMoeglichBis'); ?> "+frist+"'><input style='width: 140px;' type='button' value='"+termin+" "+time+"' onclick='stornoAnmeldung(\""+anmeldung_id+"\");'></a></p>";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
//button = "<p><span style='display: inline-block; width: 155px;'>Anmelden (bis "+frist+"): </span><input style='width: 90px;' type='button' value='"+termin+"' onclick='openDialog(\""+e.lehrveranstaltung[0].lehrveranstaltung_id+"\", \""+d.pruefungstermin_id+"\", \""+e.lehrveranstaltung[0].bezeichnung+"\", \""+d.von+"\", \""+d.bis+"\");'></p>";
|
||||
button = "<p><a href='#' title='<?php echo $p->t('pruefung/anmeldenMoeglichBis'); ?> "+frist+"';><input style='width: 140px; background-color: green;' type='button' value='"+termin+" "+time+"' onclick='openDialog(\""+e.lehrveranstaltung[0].lehrveranstaltung_id+"\", \""+d.pruefungstermin_id+"\", \""+e.lehrveranstaltung[0].bezeichnung+"\", \""+d.von+"\", \""+d.bis+"\");'></a></p>";
|
||||
button = "<p><a href='#' title='<?php echo $p->t('pruefung/anmeldenMoeglichBis'); ?> "+frist+"'><input style='width: 140px; background-color: green;' type='button' value='"+termin+" "+time+"' onclick='openDialog(\""+e.lehrveranstaltung[0].lehrveranstaltung_id+"\", \""+d.pruefungstermin_id+"\", \""+e.lehrveranstaltung[0].bezeichnung.replace("'", "'")+"\", \""+d.von+"\", \""+d.bis+"\");'></a></p>";
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -133,6 +133,10 @@ $studiensemester->getAll();
|
||||
margin: 0;
|
||||
height: 24px;
|
||||
}
|
||||
.ui-dialog
|
||||
{
|
||||
z-index: 101;
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
@@ -140,11 +144,11 @@ $studiensemester->getAll();
|
||||
<script>
|
||||
var count = 0;
|
||||
$(document).ajaxSend(function(event, xhr, options){
|
||||
count++;
|
||||
//count++;
|
||||
});
|
||||
|
||||
$(document).ajaxComplete(function(event, xhr, settings){
|
||||
count--;
|
||||
//count--;
|
||||
//Wenn alle AJAX-Request fertig sind
|
||||
if(count===0)
|
||||
{
|
||||
|
||||
@@ -46,7 +46,9 @@ $std_obj = new student($user);
|
||||
if(!$is_lector)
|
||||
{
|
||||
$fkt = new benutzerfunktion();
|
||||
if($fkt->benutzerfunktion_exists($user, 'stdv'))
|
||||
if($fkt->benutzerfunktion_exists($user, 'stdv', true)) // Studienvertretung
|
||||
$is_stdv=true;
|
||||
elseif($fkt->benutzerfunktion_exists($user, 'hsv', true)) // Hochschulvertretung
|
||||
$is_stdv=true;
|
||||
}
|
||||
|
||||
|
||||
@@ -24,13 +24,31 @@ require_once('../../include/functions.inc.php');
|
||||
require_once('../../include/phrasen.class.php');
|
||||
require_once('../../include/basis_db.class.php');
|
||||
require_once('../../include/gruppe.class.php');
|
||||
require_once('../../include/student.class.php');
|
||||
require_once('../../include/benutzerfunktion.class.php');
|
||||
require_once('../../include/studiengang.class.php');
|
||||
|
||||
$sprache = getSprache();
|
||||
$p = new phrasen($sprache);
|
||||
$uid = get_uid();
|
||||
|
||||
$is_lector=check_lektor($uid);
|
||||
$is_stdv=false;
|
||||
$std_obj = new student($uid);
|
||||
|
||||
//Studien- und Hochschulvertreter duerfen den Verteiler tw_std oeffnen
|
||||
if(!$is_lector)
|
||||
{
|
||||
$fkt = new benutzerfunktion();
|
||||
if($fkt->benutzerfunktion_exists($uid, 'stdv', true)) // Studienvertretung
|
||||
$is_stdv=true;
|
||||
elseif($fkt->benutzerfunktion_exists($uid, 'hsv', true)) // Hochschulvertretung
|
||||
$is_stdv=true;
|
||||
}
|
||||
|
||||
$db = new basis_db();
|
||||
if (!isset($_REQUEST['grp']))
|
||||
die('Falsche Parameter');
|
||||
die('Parameter "grp" wurde nicht uebergeben');
|
||||
|
||||
if (mb_strlen($_REQUEST['grp'])>32)
|
||||
die('Grp ungueltig');
|
||||
@@ -41,12 +59,30 @@ if (!$gruppe->exists($_REQUEST['grp']))
|
||||
{
|
||||
//Wenn es keine Gruppe in der DB ist, kann es
|
||||
//noch ein Studierendenverteiler sein
|
||||
//bif_std
|
||||
//zb bif_std oder tw_std
|
||||
if (!preg_match('/^\D\D\D_std$/', $_REQUEST['grp']))
|
||||
{
|
||||
die('Ungueltige Gruppe');
|
||||
}
|
||||
else
|
||||
{
|
||||
// Kürzel aus Gruppe auslesen
|
||||
$studiengang_kuerzel = substr($_REQUEST['grp'], 0, strpos($_REQUEST['grp'], '_'));
|
||||
$studiengang = new studiengang();
|
||||
$studiengang->getStudiengangFromOe($studiengang_kuerzel);
|
||||
|
||||
// Lektoren oder Studierende dieses Studiengangs dürfen
|
||||
if (!$is_lector && $std_obj->studiengang_kz != $studiengang->studiengang_kz)
|
||||
die('Sie haben keine Berechtigung zum öffnen dieses Mailverteilers');
|
||||
}
|
||||
}
|
||||
elseif (!$is_lector && $_REQUEST['grp'] == 'tw_std')
|
||||
{
|
||||
//Studien- und Hochschulvertreter duerfen den Verteiler tw_std oeffnen
|
||||
if ($is_stdv === false)
|
||||
die('!$is_lector Sie haben keine Berechtigung zum öffnen dieses Mailverteilers');
|
||||
}
|
||||
|
||||
function mail_id_generator()
|
||||
{
|
||||
mt_srand((double)microtime()*1000000);
|
||||
|
||||
+308
-260
@@ -16,9 +16,9 @@
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* Authors: Christian Paminger <christian.paminger@technikum-wien.at>,
|
||||
* Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at>,
|
||||
* Rudolf Hangl <rudolf.hangl@technikum-wien.at> and
|
||||
* Gerald Simane-Sequens < gerald.simane-sequens@technikum-wien.at>.
|
||||
* Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at>,
|
||||
* Rudolf Hangl <rudolf.hangl@technikum-wien.at> and
|
||||
* Gerald Simane-Sequens < gerald.simane-sequens@technikum-wien.at>.
|
||||
*/
|
||||
require_once('../../../config/cis.config.inc.php');
|
||||
require_once('../../../config/global.config.inc.php');
|
||||
@@ -42,7 +42,7 @@ require_once('../../../include/gruppe.class.php');
|
||||
require_once('../../../include/adresse.class.php');
|
||||
|
||||
$sprache = getSprache();
|
||||
$p=new phrasen($sprache);
|
||||
$p = new phrasen($sprache);
|
||||
|
||||
if (!$db = new basis_db())
|
||||
die($p->t('global/fehlerBeimOeffnenDerDatenbankverbindung'));
|
||||
@@ -51,39 +51,39 @@ $uid = get_uid();
|
||||
|
||||
$datum_obj = new datum();
|
||||
|
||||
$ansicht=false; //Wenn ein anderer User sich das Profil ansieht (Bei Personensuche)
|
||||
if(isset($_GET['uid']))
|
||||
$ansicht = false; //Wenn ein anderer User sich das Profil ansieht (Bei Personensuche)
|
||||
if (isset($_GET['uid']))
|
||||
{
|
||||
$uid=stripslashes($_GET['uid']);
|
||||
$ansicht=true;
|
||||
$uid = stripslashes($_GET['uid']);
|
||||
$ansicht = true;
|
||||
}
|
||||
|
||||
if(!$ansicht && isset($_GET['action']))
|
||||
if (!$ansicht && isset($_GET['action']))
|
||||
{
|
||||
switch($_GET['action'])
|
||||
{
|
||||
case 'foto_freigabe':
|
||||
$benutzer = new benutzer();
|
||||
if($benutzer->load($uid))
|
||||
if ($benutzer->load($uid))
|
||||
{
|
||||
$person = new person();
|
||||
if($person->load($benutzer->person_id))
|
||||
if ($person->load($benutzer->person_id))
|
||||
{
|
||||
$person->foto_sperre=false;
|
||||
$person->new=false;
|
||||
$person->foto_sperre = false;
|
||||
$person->new = false;
|
||||
$person->save();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'foto_sperre':
|
||||
$benutzer = new benutzer();
|
||||
if($benutzer->load($uid))
|
||||
if ($benutzer->load($uid))
|
||||
{
|
||||
$person = new person();
|
||||
if($person->load($benutzer->person_id))
|
||||
if ($person->load($benutzer->person_id))
|
||||
{
|
||||
$person->foto_sperre=true;
|
||||
$person->new=false;
|
||||
$person->foto_sperre = true;
|
||||
$person->new = false;
|
||||
$person->save();
|
||||
}
|
||||
}
|
||||
@@ -98,9 +98,9 @@ $stg_obj->getAll('typ, kurzbz', false);
|
||||
|
||||
$stg_arr = array();
|
||||
foreach ($stg_obj->result as $row)
|
||||
$stg_arr[$row->studiengang_kz]=$row->kurzbzlang;
|
||||
$stg_arr[$row->studiengang_kz] = $row->kurzbzlang;
|
||||
|
||||
if(check_lektor($uid))
|
||||
if (check_lektor($uid))
|
||||
{
|
||||
$user = new mitarbeiter();
|
||||
$type = 'mitarbeiter';
|
||||
@@ -108,13 +108,13 @@ if(check_lektor($uid))
|
||||
else
|
||||
{
|
||||
$user = new student();
|
||||
$type='student';
|
||||
$type = 'student';
|
||||
}
|
||||
|
||||
if(!$user->load($uid))
|
||||
if (!$user->load($uid))
|
||||
die($p->t('profil/esWurdenKeineProfileGefunden'));
|
||||
|
||||
if ($type=='mitarbeiter')
|
||||
if ($type == 'mitarbeiter')
|
||||
{
|
||||
$vorwahl = '';
|
||||
$kontakt = new kontakt();
|
||||
@@ -130,11 +130,11 @@ echo '<!DOCTYPE HTML>
|
||||
<link href="../../../skin/style.css.php" rel="stylesheet" type="text/css">
|
||||
<link href="../../../skin/flexcrollstyles.css" rel="stylesheet" type="text/css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../../skin/jquery-ui-1.9.2.custom.min.css">
|
||||
<script type="text/javascript" src="../../../vendor/jquery/jqueryV1/jquery-1.12.4.min.js"></script>
|
||||
<script type="text/javascript" src="../../../vendor/christianbach/tablesorter/jquery.tablesorter.min.js"></script>
|
||||
<script type="text/javascript" src="../../../vendor/components/jqueryui/jquery-ui.min.js"></script>
|
||||
<script type="text/javascript" src="../../../include/js/jquery.ui.datepicker.translation.js"></script>
|
||||
<script type="text/javascript" src="../../../vendor/jquery/sizzle/sizzle.js"></script>
|
||||
<script type="text/javascript" src="../../../vendor/jquery/jqueryV1/jquery-1.12.4.min.js"></script>
|
||||
<script type="text/javascript" src="../../../vendor/christianbach/tablesorter/jquery.tablesorter.min.js"></script>
|
||||
<script type="text/javascript" src="../../../vendor/components/jqueryui/jquery-ui.min.js"></script>
|
||||
<script type="text/javascript" src="../../../include/js/jquery.ui.datepicker.translation.js"></script>
|
||||
<script type="text/javascript" src="../../../vendor/jquery/sizzle/sizzle.js"></script>
|
||||
<link rel="stylesheet" href="../../../skin/tablesort.css" type="text/css"/>
|
||||
<script language="JavaScript" type="text/javascript">
|
||||
<!--
|
||||
@@ -165,14 +165,13 @@ echo '<!DOCTYPE HTML>
|
||||
<h1>'.$p->t('profil/profil').'</h1>
|
||||
';
|
||||
|
||||
if(!$user->bnaktiv)
|
||||
if (!$user->bnaktiv)
|
||||
{
|
||||
if(!$ansicht)
|
||||
if (!$ansicht)
|
||||
{
|
||||
|
||||
if ($type=='student')
|
||||
if ($type == 'student')
|
||||
$message = $p->t('profil/inaktivStudent');
|
||||
elseif($type=='mitarbeiter')
|
||||
elseif ($type == 'mitarbeiter')
|
||||
$message = $p->t('profil/inaktivMitarbeiter');
|
||||
else
|
||||
$message = $p->t('profil/inaktivSonstige');
|
||||
@@ -180,7 +179,7 @@ if(!$user->bnaktiv)
|
||||
else
|
||||
$message = $p->t('profil/AccountInaktiv');
|
||||
|
||||
echo "<span style='color: red;'>$message</span>";
|
||||
echo '<span style="color: red;">'.$message.'</span>';
|
||||
}
|
||||
|
||||
echo '
|
||||
@@ -190,16 +189,16 @@ echo '
|
||||
<td class="cmscontent" rowspan="3" valign="top">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td valign="top" width="10%" nowrap style="padding-right:10px;">';
|
||||
<td valign="top" width="10%" nowrap style="padding-right:10px;">';
|
||||
|
||||
//Foto anzeigen
|
||||
$benutzer = new benutzer();
|
||||
$benutzer->load($uid);
|
||||
$person = new person();
|
||||
$person->load($benutzer->person_id);
|
||||
if($person->foto!='')
|
||||
if ($person->foto != '')
|
||||
{
|
||||
if(!($ansicht && $user->foto_sperre))
|
||||
if (!($ansicht && $user->foto_sperre))
|
||||
echo '<img id="personimage" src="../../public/bild.php?src=person&person_id='.$user->person_id.'" alt="'.$user->person_id.'" height="100px" width="75px">';
|
||||
else
|
||||
echo '<img id="personimage" src="../../../skin/images/profilbild_dummy.jpg" alt="Dummy Picture" height="100px" width="75px">';
|
||||
@@ -207,19 +206,19 @@ if($person->foto!='')
|
||||
else
|
||||
echo '<img id="personimage" src="../../../skin/images/profilbild_dummy.jpg" alt="Dummy Picture" height="100px" width="75px">';
|
||||
|
||||
if(!$ansicht)
|
||||
if (!$ansicht)
|
||||
{
|
||||
//Foto Upload nur möglich wenn das Bild noch nicht akzeptiert wurde
|
||||
$fs = new fotostatus();
|
||||
if(!$fs->akzeptiert($user->person_id))
|
||||
if (!$fs->akzeptiert($user->person_id))
|
||||
echo "<br><a href='#BildUpload' onclick='window.open(\"../bildupload.php?person_id=$user->person_id\",\"BildUpload\", \"height=800,width=800,left=0,top=0,hotkeys=0,resizable=yes,status=no,scrollbars=yes,toolbar=no,location=no,menubar=no,dependent=yes\"); return false;'>".$p->t('profil/bildHochladen')."</a>";
|
||||
}
|
||||
if($user->foto_sperre)
|
||||
if ($user->foto_sperre)
|
||||
echo '<br><b>'.$p->t('profil/profilfotoGesperrt').'</b>';
|
||||
|
||||
if(!$ansicht)
|
||||
if (!$ansicht)
|
||||
{
|
||||
if($user->foto_sperre)
|
||||
if ($user->foto_sperre)
|
||||
echo '<br><a href="'.$_SERVER['PHP_SELF'].'?action=foto_freigabe" title="'.$p->t('profil/infotextSperre').'">'.$p->t('profil/fotofreigeben').'</a>';
|
||||
else
|
||||
echo '<br><a href="'.$_SERVER['PHP_SELF'].'?action=foto_sperre" title="'.$p->t('profil/infotextSperre').'">'.$p->t('profil/fotosperren').'</a>';
|
||||
@@ -228,67 +227,67 @@ if(!$ansicht)
|
||||
echo '</td><td width="30%" valign="top">';
|
||||
|
||||
echo '
|
||||
<b>'.($type=="student"?$p->t("profil/student"):$p->t('profil/mitarbeiter')).'</b><br><br>
|
||||
<b>'.($type == "student"?$p->t("profil/student"):$p->t('profil/mitarbeiter')).'</b><br><br>
|
||||
'.$p->t('global/username').': '.$user->uid.'<br>
|
||||
'.$p->t('global/anrede').': '.$user->anrede.'<br>
|
||||
'.$p->t('global/titel').': '.$user->titelpre.' <br>';
|
||||
|
||||
if(!$ansicht)
|
||||
if (!$ansicht)
|
||||
echo $p->t('global/vorname').': '.$user->vorname.' '.$user->vornamen.'<br>';
|
||||
else
|
||||
echo $p->t('global/vorname').': '.$user->vorname.' <br>';
|
||||
|
||||
echo '
|
||||
'.$p->t('global/nachname').': '.$user->nachname.'<br>
|
||||
'.$p->t('global/postnomen').': '.$user->titelpost.'<br><br>';
|
||||
'.$p->t('global/nachname').': '.$user->nachname.'<br>
|
||||
'.$p->t('global/postnomen').': '.$user->titelpost.'<br><br>';
|
||||
|
||||
if(!$ansicht)
|
||||
if (!$ansicht)
|
||||
{
|
||||
echo ' '.$p->t('global/geburtsdatum').': '.$datum_obj->formatDatum($user->gebdatum,'d.m.Y')."<br>
|
||||
".$p->t('global/geburtsort').": $user->gebort<br><br>";
|
||||
|
||||
}
|
||||
|
||||
if(!$ansicht)
|
||||
if (!$ansicht)
|
||||
{
|
||||
$adresse = new adresse();
|
||||
$adresse->load_pers($user->person_id);
|
||||
$adresse = new adresse();
|
||||
$adresse->load_pers($user->person_id);
|
||||
|
||||
function sortAdresse($a , $b)
|
||||
{
|
||||
if($a->typ === $b->typ)
|
||||
return 0;
|
||||
function sortAdresse($a , $b)
|
||||
{
|
||||
if ($a->typ === $b->typ)
|
||||
return 0;
|
||||
|
||||
return ($a->typ < $b->typ) ? -1 : 1;
|
||||
}
|
||||
usort($adresse->result, "sortAdresse");
|
||||
foreach($adresse->result as $a)
|
||||
{
|
||||
if($a->zustelladresse)
|
||||
}
|
||||
usort($adresse->result, "sortAdresse");
|
||||
foreach($adresse->result as $a)
|
||||
{
|
||||
if ($a->zustelladresse)
|
||||
{
|
||||
switch ($a->typ)
|
||||
{
|
||||
case "h":
|
||||
$typ = $p->t("global/hauptwohnsitz");
|
||||
break;
|
||||
$typ = $p->t("global/hauptwohnsitz");
|
||||
break;
|
||||
case "n":
|
||||
$typ = $p->t("global/nebenwohnsitz");
|
||||
break;
|
||||
$typ = $p->t("global/nebenwohnsitz");
|
||||
break;
|
||||
default:
|
||||
$typ = NULL;
|
||||
break;
|
||||
$typ = NULL;
|
||||
break;
|
||||
}
|
||||
if($typ !== NULL)
|
||||
if ($typ !== NULL)
|
||||
{
|
||||
echo "<b>".$typ.": </b><br>";
|
||||
echo $a->strasse."<br>".$a->plz." ".$a->ort."<br><br>";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$studiengang = new studiengang();
|
||||
if ($type=='student' && (!defined('CIS_PROFIL_STUDIENINFORMATION_ANZEIGEN') || CIS_PROFIL_STUDIENINFORMATION_ANZEIGEN))
|
||||
if ($type == 'student' && (!defined('CIS_PROFIL_STUDIENINFORMATION_ANZEIGEN') || CIS_PROFIL_STUDIENINFORMATION_ANZEIGEN))
|
||||
{
|
||||
$studiengang->load($user->studiengang_kz);
|
||||
|
||||
@@ -298,30 +297,30 @@ if ($type=='student' && (!defined('CIS_PROFIL_STUDIENINFORMATION_ANZEIGEN') || C
|
||||
".$p->t('global/verband').": $user->verband ".($user->verband!=' '?"<a href='#' onClick='javascript:window.open(\"../stud_in_grp.php?kz=$user->studiengang_kz&sem=$user->semester&verband=$user->verband\",\"_blank\",\"width=600,height=500,location=no,menubar=no,status=no,toolbar=no,scrollbars=yes, resizable=1\");return false;'>".$p->t('benotungstool/liste')."</a>":"")."<br>
|
||||
".$p->t('global/gruppe').": $user->gruppe ".($user->gruppe!=' '?"<a href='#' onClick='javascript:window.open(\"../stud_in_grp.php?kz=$user->studiengang_kz&sem=$user->semester&verband=$user->verband&grp=$user->gruppe\",\"_blank\",\"width=600,height=500,location=no,menubar=no,status=no,toolbar=no,scrollbars=yes, resizable=1\");return false;'>".$p->t('benotungstool/liste')."</a>":"")."<br>";
|
||||
|
||||
if($user->studiengang_kz<10000)
|
||||
if ($user->studiengang_kz<10000)
|
||||
echo $p->t('profil/martrikelnummer').": $user->matrikelnr<br />";
|
||||
}
|
||||
|
||||
if ($type=='mitarbeiter')
|
||||
if ($type == 'mitarbeiter')
|
||||
{
|
||||
echo "<br>
|
||||
".$p->t('profil/kurzzeichen').": $user->kurzbz<BR>";
|
||||
|
||||
if($user->telefonklappe!='')
|
||||
if ($user->telefonklappe != '')
|
||||
{
|
||||
echo $p->t('profil/telefonTw').": $vorwahl - $user->telefonklappe<BR>";
|
||||
//echo $p->t('profil/faxTw').": $vorwahl - 99 $user->telefonklappe<BR>";
|
||||
}
|
||||
if ($user->ort_kurzbz!='')
|
||||
if ($user->ort_kurzbz != '')
|
||||
echo $p->t('profil/buero').': '.$user->ort_kurzbz.'<br>';
|
||||
}
|
||||
echo '</td>';
|
||||
echo '<td valign="top">';
|
||||
if(!$ansicht && (!defined('CIS_PROFIL_FHAUSWEIS_ANZEIGEN') || CIS_PROFIL_FHAUSWEIS_ANZEIGEN))
|
||||
if (!$ansicht && (!defined('CIS_PROFIL_FHAUSWEIS_ANZEIGEN') || CIS_PROFIL_FHAUSWEIS_ANZEIGEN))
|
||||
{
|
||||
echo '<b>'.$p->t('profil/fhausweisStatus').'</b><br>';
|
||||
$bm = new betriebsmittel();
|
||||
if($bm->zutrittskarteAusgegeben($user->uid))
|
||||
if ($bm->zutrittskarteAusgegeben($user->uid))
|
||||
{
|
||||
//wenn es mehr Zutrittskarten gab, wird das letzte Ausgabedatum erhalten
|
||||
$ausgegeben_am = $bm->result;
|
||||
@@ -331,7 +330,7 @@ if(!$ansicht && (!defined('CIS_PROFIL_FHAUSWEIS_ANZEIGEN') || CIS_PROFIL_FHAUSWE
|
||||
else
|
||||
{
|
||||
$fs = new fotostatus();
|
||||
if($fs->getLastFotoStatus($user->person_id))
|
||||
if ($fs->getLastFotoStatus($user->person_id))
|
||||
{
|
||||
echo '<br>'.$p->t('profil/Bild').' '.$fs->fotostatus_kurzbz.' am '.$datum_obj->formatDatum($fs->datum, 'd.m.Y');
|
||||
switch($fs->fotostatus_kurzbz)
|
||||
@@ -343,7 +342,7 @@ if(!$ansicht && (!defined('CIS_PROFIL_FHAUSWEIS_ANZEIGEN') || CIS_PROFIL_FHAUSWE
|
||||
echo '<br>'.$p->t('profil/fotoWurdeNochNichtAkzeptiert');
|
||||
break;
|
||||
case 'akzeptiert':
|
||||
if($bm->zutrittskartePrinted($user->uid))
|
||||
if ($bm->zutrittskartePrinted($user->uid))
|
||||
{
|
||||
echo '<br>'.$p->t('profil/fhausweisGedrucktAm').' '.$datum_obj->formatDatum($bm->insertamum,'d.m.Y');
|
||||
$geliefertts = $datum_obj->mktime_fromtimestamp($bm->insertamum);
|
||||
@@ -367,166 +366,191 @@ if(!$ansicht && (!defined('CIS_PROFIL_FHAUSWEIS_ANZEIGEN') || CIS_PROFIL_FHAUSWE
|
||||
echo '<br><br>';
|
||||
}
|
||||
echo '<b>'.$p->t('profil/email').'</b><br>
|
||||
'.$p->t('profil/intern').': <a href="mailto:'.$user->uid.'@'.DOMAIN.'">'.$user->uid.'@'.DOMAIN.'</a><br>';
|
||||
'.$p->t('profil/intern').': <a href="mailto:'.$user->uid.'@'.DOMAIN.'">'.$user->uid.'@'.DOMAIN.'</a><br>';
|
||||
|
||||
if($user->alias!='' && (!isset($user->studiengang_kz) || !in_array($user->studiengang_kz,$noalias)))
|
||||
if ($user->alias!='' && (!isset($user->studiengang_kz) || !in_array($user->studiengang_kz,$noalias)))
|
||||
{
|
||||
echo $p->t('profil/alias').": <a class='Item' href='mailto:$user->alias@".DOMAIN."'>$user->alias@".DOMAIN."</a>";
|
||||
}
|
||||
if(!$ansicht)
|
||||
if (!$ansicht)
|
||||
{
|
||||
function sortKontakt($a , $b)
|
||||
{
|
||||
if($a->kontakttyp === $b->kontakttyp)
|
||||
return 0;
|
||||
function sortKontakt($a , $b)
|
||||
{
|
||||
if ($a->kontakttyp === $b->kontakttyp)
|
||||
return 0;
|
||||
|
||||
return ($a->kontakttyp < $b->kontakttyp) ? -1 : 1;
|
||||
}
|
||||
echo '<br><br><b>'.$p->t('profil/kontaktPrivat').'</b>';
|
||||
$kontakt = new kontakt();
|
||||
$kontakt->load_pers($user->person_id);
|
||||
usort($kontakt->result, "sortKontakt");
|
||||
|
||||
foreach($kontakt->result as $k)
|
||||
{
|
||||
if($k->zustellung === TRUE)
|
||||
{
|
||||
switch($k->kontakttyp)
|
||||
{
|
||||
case "email":
|
||||
echo '<br>'.$p->t('profil/email').': '.$k->kontakt;
|
||||
break;
|
||||
case "mobil":
|
||||
echo '<br>'.$p->t('profil/mobil').': '.$k->kontakt;
|
||||
break;
|
||||
case "telefon":
|
||||
echo '<br>'.$p->t('profil/telefon').': '.$k->kontakt;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
echo '<br><br><b>'.$p->t('profil/kontaktPrivat').'</b>';
|
||||
$kontakt = new kontakt();
|
||||
$kontakt->load_pers($user->person_id);
|
||||
usort($kontakt->result, "sortKontakt");
|
||||
|
||||
foreach($kontakt->result as $k)
|
||||
{
|
||||
if ($k->zustellung === TRUE)
|
||||
{
|
||||
switch($k->kontakttyp)
|
||||
{
|
||||
case "email":
|
||||
echo '<br>'.$p->t('profil/email').': '.$k->kontakt;
|
||||
break;
|
||||
case "mobil":
|
||||
echo '<br>'.$p->t('profil/mobil').': '.$k->kontakt;
|
||||
break;
|
||||
case "telefon":
|
||||
echo '<br>'.$p->t('profil/telefon').': '.$k->kontakt;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($user->homepage!='')
|
||||
echo "<br><br><b>".$p->t('profil/homepage')."</b><br><br><a href='$user->homepage' target='_blank'>$user->homepage</a>";
|
||||
if ($user->homepage != '')
|
||||
{
|
||||
echo "<br><br><b>".$p->t('profil/homepage')."</b>
|
||||
<br><br><a href='$user->homepage' target='_blank'>$user->homepage</a>";
|
||||
}
|
||||
echo '</tr></table><br>';
|
||||
|
||||
$mail = MAIL_ADMIN;
|
||||
if(!isset($user->studiengang_kz) || $user->studiengang_kz=='')
|
||||
{
|
||||
$user->studiengang_kz = 0;
|
||||
}
|
||||
if (!isset($user->studiengang_kz) || $user->studiengang_kz == '')
|
||||
{
|
||||
$user->studiengang_kz = 0;
|
||||
}
|
||||
|
||||
//Wenn eine Assistentin fuer diesen Studiengang eingetragen ist,
|
||||
//dann werden die aenderungswuesche an diese Adresse gesendet
|
||||
if($studiengang->email!='')
|
||||
$mail = $studiengang->email;
|
||||
else
|
||||
$mail = MAIL_ADMIN;
|
||||
//Wenn eine Assistentin fuer diesen Studiengang eingetragen ist,
|
||||
//dann werden die aenderungswuesche an diese Adresse gesendet
|
||||
if ($studiengang->email != '')
|
||||
$mail = $studiengang->email;
|
||||
else
|
||||
$mail = MAIL_ADMIN;
|
||||
|
||||
if($user->studiengang_kz=='0')
|
||||
$mail = MAIL_GST;
|
||||
if ($user->studiengang_kz == '0')
|
||||
$mail = MAIL_GST;
|
||||
|
||||
if(!$ansicht)
|
||||
{
|
||||
echo "
|
||||
".$p->t('profil/solltenDatenNichtStimmen')." <a class='Item' href=\"mailto:$mail?subject=Datenkorrektur&body=Die%20Profildaten%20fuer%20User%20'$user->uid'%20sind%20nicht%20korrekt.%0D
|
||||
Hier die richtigen Daten:%0A%0ANachname:%20$user->nachname%0AVorname:%20$user->vorname%0AGeburtsdatum:%20$user->gebdatum
|
||||
%0AGeburtsort:%20$user->gebort%0ATitelPre:%20$user->titelpre%0ATitelPost:%20$user->titelpost
|
||||
%0A%0A***%0DPlatz fuer weitere (nicht angefuehrte Daten)%0D***\">".$p->t('profil/zustaendigeAssistenz')."</a><br><br>";
|
||||
}
|
||||
if (!$ansicht)
|
||||
{
|
||||
echo "
|
||||
".$p->t('profil/solltenDatenNichtStimmen')." <a class='Item' href=\"mailto:$mail?subject=Datenkorrektur&body=Die%20Profildaten%20fuer%20User%20'$user->uid'%20sind%20nicht%20korrekt.%0D
|
||||
Hier die richtigen Daten:%0A%0ANachname:%20$user->nachname%0AVorname:%20$user->vorname%0AGeburtsdatum:%20$user->gebdatum
|
||||
%0AGeburtsort:%20$user->gebort%0ATitelPre:%20$user->titelpre%0ATitelPost:%20$user->titelpost
|
||||
%0A%0A***%0DPlatz fuer weitere (nicht angefuehrte Daten)%0D***\">".$p->t('profil/zustaendigeAssistenz')."</a><br><br>";
|
||||
}
|
||||
|
||||
echo '<table width="100%">';
|
||||
|
||||
echo '<tr>
|
||||
<td valign="top">';
|
||||
|
||||
if(!defined('CIS_PROFIL_FUNKTIONEN_ANZEIGEN') || CIS_PROFIL_FUNKTIONEN_ANZEIGEN)
|
||||
if (!defined('CIS_PROFIL_FUNKTIONEN_ANZEIGEN') || CIS_PROFIL_FUNKTIONEN_ANZEIGEN)
|
||||
{
|
||||
|
||||
|
||||
//Funktionen
|
||||
$qry = "SELECT
|
||||
*, tbl_benutzerfunktion.oe_kurzbz as oe_kurzbz, tbl_organisationseinheit.bezeichnung as oe_bezeichnung,
|
||||
tbl_benutzerfunktion.semester, tbl_benutzerfunktion.bezeichnung as bf_bezeichnung
|
||||
tbl_benutzerfunktion.semester, tbl_benutzerfunktion.bezeichnung as bf_bezeichnung,
|
||||
tbl_benutzerfunktion.datum_von, tbl_benutzerfunktion.datum_bis
|
||||
FROM
|
||||
public.tbl_benutzerfunktion
|
||||
JOIN public.tbl_funktion USING(funktion_kurzbz)
|
||||
JOIN public.tbl_organisationseinheit USING(oe_kurzbz)
|
||||
WHERE
|
||||
uid=".$db->db_add_param($uid)." AND
|
||||
(tbl_benutzerfunktion.datum_von is null OR tbl_benutzerfunktion.datum_von<=now()) AND
|
||||
(tbl_benutzerfunktion.datum_bis is null OR tbl_benutzerfunktion.datum_bis>=now())";
|
||||
|
||||
if($result_funktion = $db->db_query($qry))
|
||||
if ($result_funktion = $db->db_query($qry))
|
||||
{
|
||||
if($db->db_num_rows($result_funktion)>0)
|
||||
if ($db->db_num_rows($result_funktion) > 0)
|
||||
{
|
||||
echo '<b>'.$p->t('profil/funktionen').'</b><table class="tablesorter" id="t1"><thead><tr><th>'.$p->t('global/bezeichnung').'</th><th>'.$p->t('global/organisationseinheit').'</th><th>'.$p->t('global/semester').'</th><th>'.$p->t('global/institut').'</th></tr></thead><tbody>';
|
||||
echo '<b>'.$p->t('profil/funktionen').'</b>
|
||||
<table class="tablesorter" id="t1">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>'.$p->t('global/bezeichnung').'</th>
|
||||
<th>'.$p->t('global/organisationseinheit').'</th>
|
||||
<th>'.$p->t('global/semester').'</th>
|
||||
<th>'.$p->t('global/institut').'</th>
|
||||
<th>'.$p->t('profil/gueltigvon').'</th>
|
||||
<th>'.$p->t('profil/gueltigbis').'</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>';
|
||||
|
||||
while($row_funktion = $db->db_fetch_object($result_funktion))
|
||||
{
|
||||
echo "<tr><td>".$row_funktion->beschreibung.($row_funktion->bf_bezeichnung!=$row_funktion->beschreibung && $row_funktion->bf_bezeichnung!=''?' - '.$row_funktion->bf_bezeichnung:'')."</td><td nowrap>".$row_funktion->organisationseinheittyp_kurzbz.' '.$row_funktion->oe_bezeichnung."</td><td>$row_funktion->semester</td><td>$row_funktion->fachbereich_kurzbz</td></tr>";
|
||||
echo "
|
||||
<tr>
|
||||
<td>".$row_funktion->beschreibung;
|
||||
if($row_funktion->bf_bezeichnung != $row_funktion->beschreibung
|
||||
&& $row_funktion->bf_bezeichnung != '')
|
||||
echo ' - '.$row_funktion->bf_bezeichnung;
|
||||
echo "</td>
|
||||
<td nowrap>".$row_funktion->organisationseinheittyp_kurzbz.' '.$row_funktion->oe_bezeichnung."</td>
|
||||
<td>$row_funktion->semester</td>
|
||||
<td>$row_funktion->fachbereich_kurzbz</td>
|
||||
<td>".$datum_obj->formatDatum($row_funktion->datum_von,'d.m.Y')."</td>
|
||||
<td>".$datum_obj->formatDatum($row_funktion->datum_bis,'d.m.Y')."</td>
|
||||
</tr>";
|
||||
}
|
||||
echo '</tbody></table><br>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!$ansicht && (!defined('CIS_PROFIL_BETRIEBSMITTEL_ANZEIGEN') || CIS_PROFIL_BETRIEBSMITTEL_ANZEIGEN))
|
||||
if (!$ansicht && (!defined('CIS_PROFIL_BETRIEBSMITTEL_ANZEIGEN') || CIS_PROFIL_BETRIEBSMITTEL_ANZEIGEN))
|
||||
{
|
||||
// Betriebsmittel Personen
|
||||
$oBetriebsmittelperson = new betriebsmittelperson();
|
||||
$oBetriebsmittelperson->result=array();
|
||||
$oBetriebsmittelperson->errormsg='';
|
||||
// Betriebsmittel Personen
|
||||
$oBetriebsmittelperson = new betriebsmittelperson();
|
||||
$oBetriebsmittelperson->result = array();
|
||||
$oBetriebsmittelperson->errormsg = '';
|
||||
|
||||
if ($oBetriebsmittelperson->getBetriebsmittelPerson($user->person_id))
|
||||
if ($oBetriebsmittelperson->getBetriebsmittelPerson($user->person_id))
|
||||
{
|
||||
if (is_array($oBetriebsmittelperson->result) && count($oBetriebsmittelperson->result)>0)
|
||||
{
|
||||
echo '<b>'.$p->t('profil/entlehnteBetriebsmittel').'</b>
|
||||
<table class="tablesorter" id="t2">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>'.$p->t('profil/betriebsmittel').'</th>
|
||||
<th>'.$p->t('profil/nummer').'</th>
|
||||
<th>'.$p->t('profil/ausgegebenAm').'</th>
|
||||
</tr>
|
||||
</thead><tbody>';
|
||||
if (is_array($oBetriebsmittelperson->result) && count($oBetriebsmittelperson->result) > 0)
|
||||
{
|
||||
echo '<b>'.$p->t('profil/entlehnteBetriebsmittel').'</b>
|
||||
<table class="tablesorter" id="t2">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>'.$p->t('profil/betriebsmittel').'</th>
|
||||
<th>'.$p->t('profil/nummer').'</th>
|
||||
<th>'.$p->t('profil/ausgegebenAm').'</th>
|
||||
</tr>
|
||||
</thead><tbody>';
|
||||
|
||||
for ($i=0;$i<count($oBetriebsmittelperson->result);$i++)
|
||||
for ($i = 0;$i < count($oBetriebsmittelperson->result);$i++)
|
||||
{
|
||||
if (empty($oBetriebsmittelperson->result[$i]->retouram) )
|
||||
{
|
||||
$bm = new betriebsmittel_betriebsmittelstatus();
|
||||
if($bm->load_last_betriebsmittel_id($oBetriebsmittelperson->result[$i]->betriebsmittel_id)
|
||||
&& $bm->betriebsmittelstatus_kurzbz<>'vorhanden')
|
||||
{
|
||||
continue;
|
||||
}
|
||||
$mailtext_inventar = " ".$p->t('mail/profilBetriebsmittelKorrektur')."?subject=Korrektur%20des%20Inventars%20".$oBetriebsmittelperson->result[$i]->inventarnummer."
|
||||
&body=Folgende%20Aenderung%20hat%20sich%20ergeben:%0A%0A
|
||||
Inventar:%20".$oBetriebsmittelperson->result[$i]->inventarnummer."%20(".$oBetriebsmittelperson->result[$i]->beschreibung.")%0A%0A
|
||||
Status:%20ausgeschieden%20%2F%20falsche%20Zuordnung%20%2F%20falsche%20Angaben%0A
|
||||
Details:%20%0A\"";
|
||||
{
|
||||
$bm = new betriebsmittel_betriebsmittelstatus();
|
||||
if ($bm->load_last_betriebsmittel_id($oBetriebsmittelperson->result[$i]->betriebsmittel_id)
|
||||
&& $bm->betriebsmittelstatus_kurzbz<>'vorhanden')
|
||||
{
|
||||
continue;
|
||||
}
|
||||
$mailtext_inventar = " ".$p->t('mail/profilBetriebsmittelKorrektur')."?subject=Korrektur%20des%20Inventars%20".$oBetriebsmittelperson->result[$i]->inventarnummer."
|
||||
&body=Folgende%20Aenderung%20hat%20sich%20ergeben:%0A%0A
|
||||
Inventar:%20".$oBetriebsmittelperson->result[$i]->inventarnummer."%20(".$db->convert_html_chars($oBetriebsmittelperson->result[$i]->beschreibung).")%0A%0A
|
||||
Status:%20ausgeschieden%20%2F%20falsche%20Zuordnung%20%2F%20falsche%20Angaben%0A
|
||||
Details:%20%0A\"";
|
||||
echo "<tr>
|
||||
<td>".$oBetriebsmittelperson->result[$i]->betriebsmitteltyp.' '.$oBetriebsmittelperson->result[$i]->beschreibung.(isset($oBetriebsmittelperson->result[$i]->verwendung)?' ('.$oBetriebsmittelperson->result[$i]->verwendung.')':'')."</td>
|
||||
<td>".$oBetriebsmittelperson->result[$i]->nummer.' <a href="mailto:'.$mailtext_inventar.'>'.$oBetriebsmittelperson->result[$i]->inventarnummer."</a></td>
|
||||
<td>".$datum_obj->formatDatum($oBetriebsmittelperson->result[$i]->ausgegebenam,'d.m.Y')."</td>
|
||||
</tr>";
|
||||
<td>".$oBetriebsmittelperson->result[$i]->betriebsmitteltyp.' '.$oBetriebsmittelperson->result[$i]->beschreibung.(isset($oBetriebsmittelperson->result[$i]->verwendung)?' ('.$oBetriebsmittelperson->result[$i]->verwendung.')':'')."</td>
|
||||
<td>".$oBetriebsmittelperson->result[$i]->nummer.' <a href="mailto:'.$mailtext_inventar.'>'.$oBetriebsmittelperson->result[$i]->inventarnummer."</a></td>
|
||||
<td>".$datum_obj->formatDatum($oBetriebsmittelperson->result[$i]->ausgegebenam,'d.m.Y')."</td>
|
||||
</tr>";
|
||||
|
||||
}
|
||||
}
|
||||
echo '</tbody></table>';
|
||||
}
|
||||
}
|
||||
echo '</tbody></table>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Zutrittsgruppen
|
||||
$gruppe = new gruppe();
|
||||
$gruppe->loadZutrittsgruppen($uid);
|
||||
if(count($gruppe->result)>0)
|
||||
if (count($gruppe->result) > 0)
|
||||
{
|
||||
echo '<b>Zutrittsgruppen</b>
|
||||
<table id="tableZutritt" class="tablesorter">
|
||||
@@ -547,103 +571,127 @@ if(!$ansicht && (!defined('CIS_PROFIL_BETRIEBSMITTEL_ANZEIGEN') || CIS_PROFIL_BE
|
||||
echo '</tr>';
|
||||
}
|
||||
echo '</tbody>
|
||||
</thead>
|
||||
</table>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
echo '
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>';
|
||||
$menubox='';
|
||||
echo '
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>';
|
||||
$menubox = '';
|
||||
|
||||
//Überprüfung ob Addon vorhanden ist
|
||||
$addon = new addon();
|
||||
//Überprüfung ob Addon vorhanden ist
|
||||
$addon = new addon();
|
||||
|
||||
foreach($addon->aktive_addons as $ad)
|
||||
{
|
||||
// checken ob es file profil_array.php gibt
|
||||
if(file_exists(DOC_ROOT.'/addons/'.$ad.'/cis/profil_array.php'))
|
||||
{
|
||||
$menu=array();
|
||||
include(DOC_ROOT.'/addons/'.$ad.'/cis/profil_array.php');
|
||||
// Wenn Mitarbeiter count == 0
|
||||
if(count($menu >0))
|
||||
{
|
||||
foreach($menu as $entry)
|
||||
{
|
||||
$menubox.= "<p><a href=".$entry['link']." target=".$entry['target'].">".$entry['name']."</a></p>";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Überprüfung ob Hilfe-Link vorhanden
|
||||
if ($p->t("dms_link/profilhilfe")!='')
|
||||
$menubox.= '<p><a href="../../../cms/content.php?content_id='.$p->t("dms_link/profilhilfe").'" target="_blank">'.$p->t('global/hilfe').'</a></p>';
|
||||
if($menubox!='')
|
||||
echo '<td class="menubox">'.$menubox;
|
||||
else
|
||||
echo '<td>';
|
||||
echo'</td></tr>
|
||||
<tr>
|
||||
<td class="teambox" style="width: 20%;">';
|
||||
if(!defined('CIS_PROFIL_MAILVERTEILER_ANZEIGEN') || CIS_PROFIL_MAILVERTEILER_ANZEIGEN)
|
||||
foreach($addon->aktive_addons as $ad)
|
||||
{
|
||||
// checken ob es file profil_array.php gibt
|
||||
if (file_exists(DOC_ROOT.'/addons/'.$ad.'/cis/profil_array.php'))
|
||||
{
|
||||
echo '<B>'.$p->t('mailverteiler/mailverteiler').'</B><BR><BR>';
|
||||
//Mailverteiler
|
||||
if(!$ansicht)
|
||||
echo "<SMALL>".$p->t('profil/sieSindMitgliedInFolgendenVerteilern').":</SMALL>";
|
||||
else
|
||||
echo "<SMALL>".$p->t('profil/derUserIstInFolgendenVerteilern',array($user->uid)).":</SMALL>";
|
||||
$menu=array();
|
||||
include(DOC_ROOT.'/addons/'.$ad.'/cis/profil_array.php');
|
||||
|
||||
echo '<table>';
|
||||
|
||||
// Mail-Groups
|
||||
$qry_gruppen = "
|
||||
SELECT
|
||||
gruppe_kurzbz, beschreibung
|
||||
FROM
|
||||
campus.vw_persongruppe
|
||||
WHERE
|
||||
mailgrp
|
||||
AND uid=".$db->db_add_param($uid);
|
||||
|
||||
if(!($erg_mg=$db->db_query($qry_gruppen)))
|
||||
die($db->db_last_error());
|
||||
$nr_mg=$db->db_num_rows($erg_mg);
|
||||
|
||||
for($i=0;$i<$nr_mg;$i++)
|
||||
if (count($menu) > 0)
|
||||
{
|
||||
$row=$db->db_fetch_object($erg_mg,$i);
|
||||
echo '<TR><TD><A href="mailto:'.strtolower(trim($row->gruppe_kurzbz)).'@'.DOMAIN.'">'.strtolower($row->gruppe_kurzbz).' </TD>';
|
||||
echo "<TD> $row->beschreibung</TD></TR>";
|
||||
foreach($menu as $entry)
|
||||
{
|
||||
$menubox.= '<p><a href="'.$entry['link'].'" target="'.$entry['target'].'">'.$entry['name'].'</a></p>';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($user->matrikelnr))
|
||||
//Überprüfung ob Hilfe-Link vorhanden
|
||||
if ($p->t("dms_link/profilhilfe") != '')
|
||||
$menubox .= '<p><a href="../../../cms/content.php?content_id='.$p->t("dms_link/profilhilfe").'" target="_blank">'.$p->t('global/hilfe').'</a></p>';
|
||||
if ($menubox != '')
|
||||
echo '<td class="menubox">'.$menubox;
|
||||
else
|
||||
echo '<td>';
|
||||
echo'</td></tr>
|
||||
<tr>
|
||||
<td class="teambox" style="width: 20%;">';
|
||||
if (!defined('CIS_PROFIL_MAILVERTEILER_ANZEIGEN') || CIS_PROFIL_MAILVERTEILER_ANZEIGEN)
|
||||
{
|
||||
echo '<b>'.$p->t('mailverteiler/mailverteiler').'</b><br /><br />';
|
||||
//Mailverteiler
|
||||
if (!$ansicht)
|
||||
echo "<small>".$p->t('profil/sieSindMitgliedInFolgendenVerteilern').":</small>";
|
||||
else
|
||||
echo "<small>".$p->t('profil/derUserIstInFolgendenVerteilern',array($user->uid)).":</small>";
|
||||
|
||||
echo '<table>';
|
||||
|
||||
// Mail-Groups
|
||||
$qry_gruppen = "
|
||||
SELECT
|
||||
gruppe_kurzbz, beschreibung
|
||||
FROM
|
||||
campus.vw_persongruppe
|
||||
WHERE
|
||||
mailgrp
|
||||
AND uid=".$db->db_add_param($uid);
|
||||
|
||||
if (!($erg_mg = $db->db_query($qry_gruppen)))
|
||||
die($db->db_last_error());
|
||||
$nr_mg = $db->db_num_rows($erg_mg);
|
||||
|
||||
for ($i = 0;$i < $nr_mg;$i++)
|
||||
{
|
||||
$row = $db->db_fetch_object($erg_mg,$i);
|
||||
$mailverteiler = strtolower(trim($row->gruppe_kurzbz)).'@'.DOMAIN;
|
||||
echo '
|
||||
<tr>
|
||||
<td><a href="mailto:'.$mailverteiler.'">'.strtolower($row->gruppe_kurzbz).'</a></td>
|
||||
<td>'.$row->beschreibung.'</td>
|
||||
</tr>';
|
||||
}
|
||||
|
||||
if (isset($user->matrikelnr))
|
||||
{
|
||||
$stdverteiler = strtolower(trim($studiengang->kuerzel)).'_std';
|
||||
$semesterverteiler = strtolower(trim($studiengang->kuerzel)).trim($user->semester);
|
||||
$verbandverteiler = strtolower(trim($studiengang->kuerzel)).trim($user->semester).strtolower(trim($user->verband));
|
||||
echo '
|
||||
<tr>
|
||||
<td><a href="mailto:'.$stdverteiler.'@'.DOMAIN.'">'.$stdverteiler.'</a></td>
|
||||
<td>'.$p->t('profil/alleStudentenVon').' '.$studiengang->kuerzel.'</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="mailto:'.$semesterverteiler.'@'.DOMAIN.'">'.$semesterverteiler.'</a></td>
|
||||
<td>'.$p->t('profil/alleStudentenVon').' '.$studiengang->kuerzel.' '.$user->semester.'</td>
|
||||
</tr>';
|
||||
if(trim($user->verband) != '')
|
||||
{
|
||||
echo '<TR><TD><A href="mailto:'.strtolower(trim($studiengang->kuerzel)).'_std@'.DOMAIN.'">'.strtolower($studiengang->kuerzel).'_std </TD>';
|
||||
echo "<TD> ".$p->t('profil/alleStudentenVon')." $studiengang->kuerzel</TD></TR>";
|
||||
echo '<TR><TD><A href="mailto:'.strtolower(trim($studiengang->kuerzel)).trim($user->semester).'@'.DOMAIN.'">'.strtolower($studiengang->kuerzel).$user->semester.' </TD>';
|
||||
echo "<TD> ".$p->t('profil/alleStudentenVon')." $studiengang->kuerzel $user->semester</TD></TR>";
|
||||
echo '<TR><TD><A href="mailto:'.strtolower(trim($studiengang->kuerzel)).trim($user->semester).strtolower(trim($user->verband)).'@'.DOMAIN.'">'.strtolower($studiengang->kuerzel).$user->semester.strtolower($user->verband).' </TD>';
|
||||
echo "<TD> ".$p->t('profil/alleStudentenVon')." $studiengang->kuerzel $user->semester$user->verband</TD></TR>";
|
||||
if(trim($user->gruppe)!='')
|
||||
{
|
||||
echo '<TR><TD><A href="mailto:'.strtolower(trim($studiengang->kuerzel)).trim($user->semester).strtolower(trim($user->verband)).trim($user->gruppe).'@'.DOMAIN.'">'.strtolower($studiengang->kuerzel).$user->semester.strtolower($user->verband).$user->gruppe.' </TD>';
|
||||
echo "<TD> ".$p->t('profil/alleStudentenVon')." $studiengang->kuerzel $user->semester$user->verband$user->gruppe</TD><TD></TD></TR>";
|
||||
}
|
||||
echo '
|
||||
<tr>
|
||||
<td><a href="mailto:'.$verbandverteiler.'@'.DOMAIN.'">'.$verbandverteiler.'</a></td>
|
||||
<td>'.$p->t('profil/alleStudentenVon').' '.$studiengang->kuerzel.' '.$user->semester.$user->verband.'</td>
|
||||
</tr>';
|
||||
if (trim($user->gruppe) != '')
|
||||
{
|
||||
$grpverteiler = strtolower(trim($studiengang->kuerzel)).trim($user->semester);
|
||||
$grpverteiler .= strtolower(trim($user->verband)).trim($user->gruppe);
|
||||
|
||||
echo '
|
||||
<tr>
|
||||
<td><a href="mailto:'.$grpverteiler.'@'.DOMAIN.'">'.$grpverteiler.'</a></td>
|
||||
<td>'.$p->t('profil/alleStudentenVon').' '.$studiengang->kuerzel.' '.
|
||||
$user->semester.$user->verband.$user->gruppe.'</td>
|
||||
</tr>';
|
||||
}
|
||||
}
|
||||
}
|
||||
echo ' </table>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>';
|
||||
?>
|
||||
</div>
|
||||
}
|
||||
echo ' </table>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
';
|
||||
|
||||
@@ -738,7 +738,11 @@ if($projekt->getProjekteMitarbeiter($user, true))
|
||||
<td class='menubox' height='10px'>";
|
||||
if ($p->t("dms_link/handbuchZeitaufzeichnung")!='')
|
||||
{
|
||||
echo '<p><a href="../../../cms/dms.php?id='.$p->t("dms_link/handbuchZeitaufzeichnung").'" target="_blank">'.$p->t("zeitaufzeichnung/handbuchZeitaufzeichnung").'</a></p>';
|
||||
// An der FHTW wird ins Moodle verlinkt
|
||||
if (CAMPUS_NAME == 'FH Technikum Wien')
|
||||
echo '<p><a href="https://moodle.technikum-wien.at/course/view.php?id=6251" target="_blank">'.$p->t("zeitaufzeichnung/handbuchZeitaufzeichnung").'</a></p>';
|
||||
else
|
||||
echo '<p><a href="../../../cms/dms.php?id='.$p->t("dms_link/handbuchZeitaufzeichnung").'" target="_blank">'.$p->t("zeitaufzeichnung/handbuchZeitaufzeichnung").'</a></p>';
|
||||
}
|
||||
if ($p->t("dms_link/fiktiveNormalarbeitszeit")!='')
|
||||
{
|
||||
|
||||
@@ -79,8 +79,11 @@ if(!isset($_POST['submit']))
|
||||
echo ' <form action="registration.php" method="POST" name="RegistrationForm">
|
||||
<table border = "0" style="margin: auto; width: 60%; margin-top:5%;">
|
||||
<tr>
|
||||
<td>'.$p->t('global/titel').' Pre</td>
|
||||
<td><input type="text" size="20" maxlength="64" name="titel_pre"></td>
|
||||
<td colspan="2" style="border-bottom: 1px solid grey; padding-bottom: 10px;">'.$p->t('incoming/datenschutzHinweisRegistration').'</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding-top: 10px;">'.$p->t('global/titel').' Pre</td>
|
||||
<td style="padding-top: 10px;"><input type="text" size="20" maxlength="64" name="titel_pre"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>'.$p->t('incoming/vorname').'*</td>
|
||||
@@ -137,7 +140,7 @@ echo ' <form action="registration.php" method="POST" name="RegistrationForm">
|
||||
<td><input type="text" size="40" maxlength="256" name="ort"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>'.$p->t('incoming/nation').'</td>
|
||||
<td>'.$p->t('incoming/nation').'*</td>
|
||||
<td><SELECT name="nation">
|
||||
<option value="nat_auswahl">-- select --</option>';
|
||||
foreach ($nation->nation as $nat)
|
||||
|
||||
@@ -5,61 +5,60 @@
|
||||
*/
|
||||
|
||||
// Error Reporting
|
||||
ini_set('display_errors','1');
|
||||
ini_set('display_errors', '1');
|
||||
error_reporting(E_ALL);
|
||||
|
||||
// Encoding
|
||||
mb_internal_encoding("UTF-8");
|
||||
mb_regex_encoding("UTF-8");
|
||||
setlocale (LC_ALL, 'de_DE.UTF8','de_DE@euro', 'de_DE', 'de','DE', 'ge','German');
|
||||
mb_internal_encoding('UTF-8');
|
||||
mb_regex_encoding('UTF-8');
|
||||
setlocale (LC_ALL, 'de_DE.UTF8', 'de_DE@euro', 'de_DE', 'de', 'DE', 'ge', 'German');
|
||||
|
||||
// Zeitzone
|
||||
date_default_timezone_set('Europe/Vienna');
|
||||
|
||||
// Connection Strings zur Datenbank
|
||||
define("DB_SYSTEM","pgsql");
|
||||
define("DB_HOST","localhost");
|
||||
define("DB_PORT","5432");
|
||||
define("DB_NAME","fhcomplete");
|
||||
define("DB_USER","vilesci");
|
||||
define("DB_PASSWORD","vilesci");
|
||||
define("DB_CONNECT_PERSISTENT",TRUE);
|
||||
define('CONN_CLIENT_ENCODING','UTF-8' );
|
||||
define('DB_SYSTEM', 'pgsql');
|
||||
define('DB_HOST', 'localhost');
|
||||
define('DB_PORT', '5432');
|
||||
define('DB_NAME', 'fhcomplete');
|
||||
define('DB_USER', 'vilesci');
|
||||
define('DB_PASSWORD', 'vilesci');
|
||||
define('DB_CONNECT_PERSISTENT', TRUE);
|
||||
define('CONN_CLIENT_ENCODING', 'UTF-8' );
|
||||
|
||||
//Connection String Infoscreen
|
||||
define("INFOSCREEN_USER","");
|
||||
define("INFOSCREEN_PASSWORD","");
|
||||
define('INFOSCREEN_USER', '');
|
||||
define('INFOSCREEN_PASSWORD', '');
|
||||
|
||||
// Name des Servers (benoetigt fuer Cronjobs
|
||||
define('SERVER_NAME','localhost');
|
||||
define('SERVER_NAME', 'localhost');
|
||||
|
||||
// URL zu FHComplete Root
|
||||
define('APP_ROOT','http://www.fhcomlete.org/build/');
|
||||
define('APP_ROOT', 'http://www.fhcomlete.org/build/');
|
||||
// URL zu RDF Verzeichnis
|
||||
define('XML_ROOT','http://www.fhcomlete.org/build/rdf/');
|
||||
define('XML_ROOT', 'http://www.fhcomlete.org/build/rdf/');
|
||||
// Pfad zu Document Root
|
||||
define('DOC_ROOT','/var/www/html/build/');
|
||||
define('DOC_ROOT', '/var/www/html/build/');
|
||||
// URL zu CIS
|
||||
define('CIS_ROOT','http://www.fhcomlete.org/build/cis/');
|
||||
define('CIS_ROOT', 'http://www.fhcomlete.org/build/cis/');
|
||||
|
||||
// Externe Funktionen - Unterordner im Include-Verzeichnis
|
||||
define('EXT_FKT_PATH','tw');
|
||||
define('EXT_FKT_PATH', 'tw');
|
||||
|
||||
// Fuer Mails etc
|
||||
define('DOMAIN','technikum-wien.at');
|
||||
define('DOMAIN', 'example.com');
|
||||
|
||||
// Ordner für DMS Dokumente
|
||||
define('DMS_PATH','/var/fhcomplete/documents/dms/');
|
||||
define('DMS_PATH', '/var/fhcomplete/documents/dms/');
|
||||
|
||||
// Authentifizierungsmethode
|
||||
// Moegliche Werte:
|
||||
// auth_mixed - htaccess mit LDAP (Default)
|
||||
// auth_demo - Demo Modus (.htaccess)
|
||||
// auth_session - Sessions mit LDAP (Testbetrieb)
|
||||
define("AUTH_SYSTEM", "auth_demo");
|
||||
define('AUTH_SYSTEM', 'auth_demo');
|
||||
// Gibt den Namen fuer die htaccess Authentifizierung an (muss mit dem Attribut AuthName im htaccess uebereinstimmen)
|
||||
define("AUTH_NAME","Technikum-Wien");
|
||||
|
||||
define('AUTH_NAME', 'FH Complete');
|
||||
|
||||
/*
|
||||
* LDAP Einstellungen
|
||||
@@ -72,53 +71,52 @@ define("AUTH_NAME","Technikum-Wien");
|
||||
* LDAP_BIND_PASSWORD: Passwort des Users falls eine Authentifizierung am LDAP noetig ist oder null
|
||||
* LDAP_USER_SEARCH_FILTER: LDAP Attribut in dem der Username steht nach dem gesucht wird (uid | sAMAccountName)
|
||||
*/
|
||||
define('LDAP_SERVER','ldap://ldap.example.com');
|
||||
define('LDAP_PORT',389);
|
||||
define('LDAP_STARTTLS',true);
|
||||
define('LDAP_BASE_DN','ou=People,dc=example,dc=com');
|
||||
define('LDAP_BIND_USER',null);
|
||||
define('LDAP_BIND_PASSWORD',null);
|
||||
define('LDAP_USER_SEARCH_FILTER','uid');
|
||||
define('LDAP_SERVER', 'ldap://ldap.example.com');
|
||||
define('LDAP_PORT', 389);
|
||||
define('LDAP_STARTTLS', true);
|
||||
define('LDAP_BASE_DN', 'ou=People,dc=example,dc=com');
|
||||
define('LDAP_BIND_USER', null);
|
||||
define('LDAP_BIND_PASSWORD', null);
|
||||
define('LDAP_USER_SEARCH_FILTER', 'uid');
|
||||
|
||||
// 2. LDAP Server (zB wenn Mitarbeiter und Studierende auf 2 getrennten Servern liegen)
|
||||
/*
|
||||
define('LDAP2_SERVER','ldaps://dc1.example.com');
|
||||
define('LDAP2_PORT',636);
|
||||
define('LDAP2_STARTTLS',false);
|
||||
define('LDAP2_BASE_DN','ou=Mitarbeiter,dc=example,dc=com');
|
||||
define('LDAP2_BIND_USER','cn=fhcomplete,dc=example,dc=com');
|
||||
define('LDAP2_BIND_PASSWORD','Pa55w0rd');
|
||||
define('LDAP2_USER_SEARCH_FILTER','sAMAccountName');
|
||||
define('LDAP2_SERVER', 'ldaps://dc1.example.com');
|
||||
define('LDAP2_PORT', 636);
|
||||
define('LDAP2_STARTTLS', false);
|
||||
define('LDAP2_BASE_DN', 'ou=Mitarbeiter,dc=example,dc=com');
|
||||
define('LDAP2_BIND_USER', 'cn=fhcomplete,dc=example,dc=com');
|
||||
define('LDAP2_BIND_PASSWORD', 'Pa55w0rd');
|
||||
define('LDAP2_USER_SEARCH_FILTER', 'sAMAccountName');
|
||||
*/
|
||||
|
||||
// LDAP MASTER SERVER fuer Passwort Aenderungen
|
||||
define('LDAP_SERVER_MASTER',LDAP_SERVER);
|
||||
define('LDAP_SERVER_MASTER', LDAP_SERVER);
|
||||
|
||||
// Default Password fuer neue Accounts
|
||||
// Hier sollte ein langes geheimes Passwort gesetzt werden!
|
||||
define('ACCOUNT_ACTIVATION_PASSWORD','');
|
||||
|
||||
define('ACCOUNT_ACTIVATION_PASSWORD', '');
|
||||
|
||||
// Attribut fuer Zutrittskartennummer im LDAP
|
||||
define("LDAP_CARD_NUMBER","twHitagCardNumber");
|
||||
define('LDAP_CARD_NUMBER', 'twHitagCardNumber');
|
||||
// Attribut fuer Zutrittskartennummer2 im LDAP
|
||||
define("LDAP_CARD_NUMBER2","twCardNumber");
|
||||
define('LDAP_CARD_NUMBER2', 'twCardNumber');
|
||||
|
||||
// Ablauffristen fuer die Accounts in Wochen (mind. 2)
|
||||
define('DEL_MITARBEITER_WEEKS','52');
|
||||
define('DEL_STUDENT_WEEKS','26');
|
||||
define('DEL_ABBRECHER_WEEKS','3');
|
||||
define('DEL_MITARBEITER_WEEKS', '52');
|
||||
define('DEL_STUDENT_WEEKS', '26');
|
||||
define('DEL_ABBRECHER_WEEKS', '3');
|
||||
|
||||
define('DEFAULT_LANGUAGE','German');
|
||||
define('DEFAULT_LANGUAGE', 'German');
|
||||
|
||||
// Wie viele Tage sollen im LVPlan angezeigt werden
|
||||
define('TAGE_PRO_WOCHE','7');
|
||||
define('TAGE_PRO_WOCHE', '7');
|
||||
|
||||
// Obergrenze fuer Semesterstunden die pro Semester pro Lektor unterrichtet werden duerfen
|
||||
// Externe Lektoren
|
||||
define('WARN_SEMESTERSTD_FREI','120');
|
||||
define('WARN_SEMESTERSTD_FREI', '120');
|
||||
// Fixangestellte Lektoren
|
||||
define('WARN_SEMESTERSTD_FIX','320');
|
||||
define('WARN_SEMESTERSTD_FIX', '320');
|
||||
|
||||
//Wochen als Grundlage zur Berechnung der Lektorenmeldung
|
||||
define('BIS_SWS_WOCHEN', 40);
|
||||
@@ -127,56 +125,64 @@ define('BIS_SWS_WOCHEN', 40);
|
||||
// Mail-Adressen (Angabe von mehreren Addressen mit ',' getrennt moeglich)
|
||||
|
||||
// Wenn MAIL_FROM gesetzt ist, werden alle Mails mit diesem Absender versandt
|
||||
define('MAIL_FROM','');
|
||||
define('MAIL_FROM', '');
|
||||
|
||||
// Wenn MAIL_DEBUG gesetzt ist, werden alle Mails an diese Adresse gesendet
|
||||
define('MAIL_DEBUG','invalid@technikum-wien.at');
|
||||
define('MAIL_DEBUG', 'invalid@example.com');
|
||||
// Geschaeftsstelle / Personalabteilung
|
||||
define('MAIL_GST','invalid@technikum-wien.at');
|
||||
define('MAIL_GST', 'invalid@example.com');
|
||||
// Administrator
|
||||
define('MAIL_ADMIN','invalid@technikum-wien.at');
|
||||
define('MAIL_ADMIN', 'invalid@example.com');
|
||||
// LVPlan-Stelle
|
||||
define('MAIL_LVPLAN','invalid@technikum-wien.at');
|
||||
define('MAIL_LVPLAN', 'invalid@example.com');
|
||||
// ServerAdministratoren
|
||||
define('MAIL_IT','invalid@technikum-wien.at');
|
||||
define('MAIL_IT', 'invalid@example.com');
|
||||
// Support
|
||||
define('MAIL_SUPPORT','invalid@technikum-wien.at');
|
||||
define('MAIL_SUPPORT', 'invalid@example.com');
|
||||
// Lehrgaenge
|
||||
define('MAIL_LG','invalid@technikum-wien.at');
|
||||
define('MAIL_LG', 'invalid@example.com');
|
||||
|
||||
// Default Anmerkung fuer neue Lehreinheiten
|
||||
// Beispiel: 'Abhaengigkeiten von anderen LV\'s\n\nSpez. Software/Equipment:\n\n'
|
||||
define ('LEHREINHEIT_ANMERKUNG_DEFAULT', '');
|
||||
|
||||
//Gibt an welche Funktion zur generierung des PDF Files herangezogen wird
|
||||
//moegliche Werte: FOP | XSLFO2PDF
|
||||
define ('PDF_CREATE_FUNCTION','XSLFO2PDF');
|
||||
|
||||
//Pfad zu den Projektarbeitsabgaben
|
||||
define('PAABGABE_PATH','/var/fhcomplete/documents/paabgabe/');
|
||||
define('PAABGABE_PATH', '/var/fhcomplete/documents/paabgabe/');
|
||||
|
||||
// ***** Mantis Bugtracker *****
|
||||
define('MANTIS_PFAD','http://www.example.com/mantis/api/soap/mantisconnect.php?wsdl');
|
||||
define('MANTIS_USERNAME',(isset($_SERVER['PHP_AUTH_USER'])?$_SERVER['PHP_AUTH_USER']:''));
|
||||
define('MANTIS_PASSWORT',(isset($_SERVER['PHP_AUTH_PW'])?$_SERVER['PHP_AUTH_PW']:''));
|
||||
define('MANTIS_PFAD', 'http://www.example.com/mantis/api/soap/mantisconnect.php?wsdl');
|
||||
define('MANTIS_USERNAME', (isset($_SERVER['PHP_AUTH_USER'])?$_SERVER['PHP_AUTH_USER']:''));
|
||||
define('MANTIS_PASSWORT', (isset($_SERVER['PHP_AUTH_PW'])?$_SERVER['PHP_AUTH_PW']:''));
|
||||
|
||||
//Name der aktiven Addons getrennt mit ;
|
||||
define('ACTIVE_ADDONS','');
|
||||
define('ACTIVE_ADDONS', '');
|
||||
|
||||
//Wenn auf 'true' gesetzt, dann wird im FAS ein 3. Feld für die Eingabe von Reihungstest
|
||||
//Punkten angezeigt
|
||||
define('RT_PUNKTE3','false');
|
||||
define('RT_PUNKTE3', 'false');
|
||||
|
||||
// **** nicht aendern ****
|
||||
define('TABLE_ID','_id');
|
||||
define('TABLE_BEGIN','tbl_');
|
||||
define('VIEW_BEGIN','vw_');
|
||||
define('TABLE_ID', '_id');
|
||||
define('TABLE_BEGIN', 'tbl_');
|
||||
define('VIEW_BEGIN', 'vw_');
|
||||
|
||||
//Legt fest ob die Personalnummer beim Anlegen NULL sein soll
|
||||
define('FAS_PERSONALNUMMER_GENERATE_NULL', false);
|
||||
|
||||
// API Informationen
|
||||
define('FHC_REST_API_KEY','testapikey@fhcomplete.org');
|
||||
define('FHC_REST_USER','username');
|
||||
define('FHC_REST_PASSWORD','password');
|
||||
define('FHC_REST_API_KEY', 'testapikey@fhcomplete.org');
|
||||
define('FHC_REST_USER', 'username');
|
||||
define('FHC_REST_PASSWORD', 'password');
|
||||
|
||||
/**
|
||||
* Signatur
|
||||
* DEFAULT: https://signatur.example.com/api/sign
|
||||
*/
|
||||
define('SIGNATUR_URL', 'https://signatur.example.com/api/sign');
|
||||
// User für Zugriff auf Signaturserver
|
||||
define('SIGNATUR_USER', 'username');
|
||||
// Passwort für Zugriff auf Signaturserver
|
||||
define('SIGNATUR_PASSWORD', 'password');
|
||||
// Signaturprofil das verwendet werden soll
|
||||
define('SIGNATUR_DEFAULT_PROFILE', 'FHC_AMT_GROSS_DE');
|
||||
?>
|
||||
|
||||
@@ -680,12 +680,6 @@ foreach($addon_obj->result as $addon)
|
||||
label = "&menu-dokumente-bescheid_deutsch.label;"
|
||||
command = "menu-dokumente-bescheid_deutsch:command"
|
||||
accesskey = "&menu-dokumente-bescheid_deutsch.accesskey;"/>
|
||||
<menuitem
|
||||
id = "menu-dokumente-bescheid_englisch"
|
||||
key = "menu-dokumente-bescheid_englisch:key"
|
||||
label = "&menu-dokumente-bescheid_englisch.label;"
|
||||
command = "menu-dokumente-bescheid_englisch:command"
|
||||
accesskey = "&menu-dokumente-bescheid_englisch.accesskey;"/>
|
||||
<menuitem
|
||||
id = "menu-dokumente-diplsupplement"
|
||||
key = "menu-dokumente-diplsupplement:key"
|
||||
|
||||
+480
-351
@@ -45,6 +45,8 @@ require_once('../include/studiengang.class.php');
|
||||
require_once('../include/studiensemester.class.php');
|
||||
require_once('../include/studienordnung.class.php');
|
||||
require_once('../include/dokument_export.class.php');
|
||||
require_once('../include/dokument.class.php');
|
||||
require_once('../include/pdf.class.php');
|
||||
|
||||
$user = get_uid();
|
||||
$db = new basis_db();
|
||||
@@ -52,414 +54,541 @@ $db = new basis_db();
|
||||
$variable_obj = new variable();
|
||||
$variable_obj->loadVariables($user);
|
||||
|
||||
//Parameter holen
|
||||
if (isset($_GET['xml']))
|
||||
$xml = $_GET['xml'];
|
||||
else
|
||||
die('Fehlerhafte Parameteruebergabe');
|
||||
if (isset($_GET['xsl']))
|
||||
$xsl = $_GET['xsl'];
|
||||
else
|
||||
die('Fehlerhafte Parameteruebergabe');
|
||||
$archivdokument = '';
|
||||
|
||||
if(isset($_GET['sign']))
|
||||
$sign = true;
|
||||
else
|
||||
$sign = false;
|
||||
|
||||
// Studiengang ermitteln dessen Vorlage verwendet werden soll
|
||||
$xsl_stg_kz = 0;
|
||||
// Direkte uebergabe des Studienganges dessen Vorlage verwendet werden soll
|
||||
if (isset($_GET['xsl_stg_kz']))
|
||||
$xsl_stg_kz = $_GET['xsl_stg_kz'];
|
||||
else
|
||||
// Wenn der Parameter archivdokument übergeben wird, werden ein oder mehrere Dokumente aus dem Archiv zu einem PDF zusammengefügt und ausgegeben
|
||||
// Ansonsten wird ein neues XML-Dokument erstellt
|
||||
if (isset($_GET['archivdokument']))
|
||||
{
|
||||
// Wenn eine Studiengangskennzahl uebergeben wird, wird die Vorlage dieses Studiengangs verwendet
|
||||
if (isset($_GET['stg_kz']))
|
||||
$xsl_stg_kz = $_GET['stg_kz'];
|
||||
else
|
||||
{
|
||||
// Werden UIDs oder Prestudent_IDs uebergeben, wird die Vorlage des Studiengangs genommen
|
||||
// in dem der 1. Studierende in der Liste ist
|
||||
if (isset($_GET['uid']) && $_GET['uid']!='')
|
||||
{
|
||||
if (strstr($_GET['uid'],';'))
|
||||
$uids = explode(';',$_GET['uid']);
|
||||
else
|
||||
$uids[1] = $_GET['uid'];
|
||||
$archivdokument = $_GET['archivdokument'];
|
||||
$allDocs = array();
|
||||
$errorText = '';
|
||||
|
||||
$dokument = new dokument();
|
||||
$dokument->loadDokumenttyp($archivdokument);
|
||||
|
||||
$pdf = new pdf();
|
||||
|
||||
// Temporaeren Ordner fuer die Erstellung der Dokumente generieren
|
||||
$tmpDir = sys_get_temp_dir() . "/fhc_archivexport_" . uniqid();
|
||||
|
||||
if (!file_exists($tmpDir))
|
||||
mkdir($tmpDir, 0777, true);
|
||||
|
||||
$student_obj = new student();
|
||||
if ($student_obj->load($uids[1]))
|
||||
// Studierende für Rechteabfrage laden
|
||||
if (isset($_GET['uid']) && $_GET['uid'] != '')
|
||||
{
|
||||
if (strstr($_GET['uid'],';'))
|
||||
{
|
||||
$uids = explode(';',$_GET['uid']);
|
||||
}
|
||||
else
|
||||
$uids[1] = $_GET['uid'];
|
||||
|
||||
$student_obj = new student();
|
||||
if ($student_obj->load($uids[1]))
|
||||
{
|
||||
$rechte = new benutzerberechtigung();
|
||||
$rechte->getBerechtigungen($user);
|
||||
|
||||
if (!$rechte->isBerechtigt('admin', $student_obj->studiengang_kz, 'suid')
|
||||
&& !$rechte->isBerechtigt('assistenz', $student_obj->studiengang_kz, 'suid'))
|
||||
die('Sie haben keine Berechtigung für diese Studierenden');
|
||||
else
|
||||
{
|
||||
$xsl_stg_kz = $student_obj->studiengang_kz;
|
||||
// Die jeweils letzte (aktuellste) Akte dieses Typs von jedem Studierenden laden und in eine temporäre Datei schreiben
|
||||
foreach ($uids AS $value)
|
||||
{
|
||||
// Leere Einträge überspringen
|
||||
if ($value == '')
|
||||
continue;
|
||||
|
||||
$student_obj = new student($value);
|
||||
$person_id = $student_obj->person_id;
|
||||
$akte = new akte();
|
||||
$akte->getAkten($person_id, $archivdokument, null, null, true, 'erstelltam DESC');
|
||||
|
||||
if (isset($akte->result[0]))
|
||||
{
|
||||
$filename = '';
|
||||
if($akte->result[0]->inhalt != '')
|
||||
{
|
||||
$filename = $tmpDir . "/" . uniqid();
|
||||
|
||||
$fileData = base64_decode($akte->result[0]->inhalt);
|
||||
file_put_contents($filename, $fileData);
|
||||
|
||||
$allDocs[] = $filename;
|
||||
}
|
||||
else
|
||||
$errorText .= "Das Dokument ".$dokument->bezeichnung." bei ".$student_obj->nachname." ".$student_obj->vorname." (".$value.") ist leer\n";
|
||||
}
|
||||
else
|
||||
$errorText .= $student_obj->nachname." ".$student_obj->vorname." (".$value.") hat kein Dokument '".$dokument->bezeichnung."' im Archiv\n";
|
||||
}
|
||||
if (count($allDocs) == 0)
|
||||
{
|
||||
rmdir($tmpDir);
|
||||
die('Bei keinem der gewählten Studierenden ist einen Bescheid vorhanden');
|
||||
}
|
||||
|
||||
// Textseite mit Errormessages generieren und in PDF umwandeln
|
||||
if ($errorText != '')
|
||||
{
|
||||
$errorfile = $tmpDir . "/" . uniqid() . ".txt";
|
||||
file_put_contents($errorfile, $errorText);
|
||||
|
||||
$newnameErrorfile = $tmpDir . "/" . uniqid();
|
||||
|
||||
$docExport = new dokument_export();
|
||||
$docExport->convert($errorfile, $newnameErrorfile, "pdf");
|
||||
unlink($errorfile);
|
||||
|
||||
// Konvertiertes File an erste Position im Array hängen
|
||||
array_unshift($allDocs, $newnameErrorfile);
|
||||
}
|
||||
|
||||
$finishedPdf = $tmpDir . "/".$archivdokument."_Album.pdf";
|
||||
$pdf->merge($allDocs, $finishedPdf);
|
||||
|
||||
foreach ($allDocs as $doc)
|
||||
unlink($doc);
|
||||
|
||||
$fsize = filesize($finishedPdf);
|
||||
|
||||
if(!$handle = fopen($finishedPdf,'r'))
|
||||
die('load failed');
|
||||
|
||||
header('Content-type: application/pdf');
|
||||
header('Content-Disposition: attachment; filename="'.$archivdokument.'_Album.pdf"');
|
||||
header('Content-Length: '.$fsize);
|
||||
|
||||
while (!feof($handle))
|
||||
{
|
||||
echo fread($handle, 8192);
|
||||
}
|
||||
fclose($handle);
|
||||
|
||||
unlink($finishedPdf);
|
||||
rmdir($tmpDir);
|
||||
}
|
||||
}
|
||||
elseif (isset($_GET['prestudent_id']) && $_GET['prestudent_id']!='')
|
||||
else
|
||||
die('Der/Die Studierenden konnte nicht geladen werden');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//Parameter holen
|
||||
if (isset($_GET['xml']))
|
||||
$xml = $_GET['xml'];
|
||||
else
|
||||
die('Fehlerhafte Parameteruebergabe');
|
||||
|
||||
if (isset($_GET['xsl']))
|
||||
$xsl = $_GET['xsl'];
|
||||
else
|
||||
die('Fehlerhafte Parameteruebergabe');
|
||||
|
||||
if(isset($_GET['sign']))
|
||||
$sign = true;
|
||||
else
|
||||
$sign = false;
|
||||
|
||||
// Studiengang ermitteln dessen Vorlage verwendet werden soll
|
||||
$xsl_stg_kz = 0;
|
||||
// Direkte uebergabe des Studienganges dessen Vorlage verwendet werden soll
|
||||
if (isset($_GET['xsl_stg_kz']))
|
||||
$xsl_stg_kz = $_GET['xsl_stg_kz'];
|
||||
else
|
||||
{
|
||||
// Wenn eine Studiengangskennzahl uebergeben wird, wird die Vorlage dieses Studiengangs verwendet
|
||||
if (isset($_GET['stg_kz']))
|
||||
$xsl_stg_kz = $_GET['stg_kz'];
|
||||
else
|
||||
{
|
||||
if (strstr($_GET['prestudent_id'],';'))
|
||||
$prestudent_ids = explode(';',$_GET['prestudent_id']);
|
||||
else
|
||||
$prestudent_ids[1] = $_GET['prestudent_id'];
|
||||
|
||||
$prestudent_obj = new prestudent();
|
||||
if ($prestudent_obj->load($prestudent_ids[1]))
|
||||
// Werden UIDs oder Prestudent_IDs uebergeben, wird die Vorlage des Studiengangs genommen
|
||||
// in dem der 1. Studierende in der Liste ist
|
||||
if (isset($_GET['uid']) && $_GET['uid']!='')
|
||||
{
|
||||
$xsl_stg_kz = $prestudent_obj->studiengang_kz;
|
||||
if (strstr($_GET['uid'],';'))
|
||||
$uids = explode(';',$_GET['uid']);
|
||||
else
|
||||
$uids[1] = $_GET['uid'];
|
||||
|
||||
$student_obj = new student();
|
||||
if ($student_obj->load($uids[1]))
|
||||
{
|
||||
$xsl_stg_kz = $student_obj->studiengang_kz;
|
||||
}
|
||||
}
|
||||
elseif (isset($_GET['prestudent_id']) && $_GET['prestudent_id']!='')
|
||||
{
|
||||
if (strstr($_GET['prestudent_id'],';'))
|
||||
$prestudent_ids = explode(';',$_GET['prestudent_id']);
|
||||
else
|
||||
$prestudent_ids[1] = $_GET['prestudent_id'];
|
||||
|
||||
$prestudent_obj = new prestudent();
|
||||
if ($prestudent_obj->load($prestudent_ids[1]))
|
||||
{
|
||||
$xsl_stg_kz = $prestudent_obj->studiengang_kz;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isset($_GET['xsl_oe_kurzbz']))
|
||||
$xsl_oe_kurzbz = $_GET['xsl_oe_kurzbz'];
|
||||
else
|
||||
$xsl_oe_kurzbz = '';
|
||||
|
||||
//Parameter setzen
|
||||
$params = 'xmlformat=xml';
|
||||
|
||||
// GET Parameter die an XML durchgereicht werden
|
||||
foreach ($_GET as $getkey=>$getvalue)
|
||||
{
|
||||
if (in_array($getkey,
|
||||
array('uid', 'stg_kz', 'person_id', 'id', 'prestudent_id', 'buchungsnummern', 'ss', 'abschlusspruefung_id',
|
||||
'typ', 'all', 'preoutgoing_id', 'lvid', 'projekt_kurzbz', 'von', 'bis', 'stundevon', 'stundebis',
|
||||
'sem', 'lehreinheit', 'mitarbeiter_uid', 'studienordnung_id', 'fixangestellt', 'standort',
|
||||
'abrechnungsmonat', 'form')
|
||||
if (isset($_GET['xsl_oe_kurzbz']))
|
||||
$xsl_oe_kurzbz = $_GET['xsl_oe_kurzbz'];
|
||||
else
|
||||
$xsl_oe_kurzbz = '';
|
||||
|
||||
//Parameter setzen
|
||||
$params = 'xmlformat=xml';
|
||||
|
||||
// GET Parameter die an XML durchgereicht werden
|
||||
foreach ($_GET as $getkey=>$getvalue)
|
||||
{
|
||||
if (in_array($getkey,
|
||||
array('uid', 'stg_kz', 'person_id', 'id', 'prestudent_id', 'buchungsnummern', 'ss', 'abschlusspruefung_id',
|
||||
'typ', 'all', 'preoutgoing_id', 'lvid', 'projekt_kurzbz', 'von', 'bis', 'stundevon', 'stundebis',
|
||||
'sem', 'lehreinheit', 'mitarbeiter_uid', 'studienordnung_id', 'fixangestellt', 'standort',
|
||||
'abrechnungsmonat', 'form')
|
||||
)
|
||||
)
|
||||
)
|
||||
{
|
||||
$params .= '&'.$getkey.'='.urlencode($getvalue);
|
||||
{
|
||||
$params .= '&'.$getkey.'='.urlencode($getvalue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_GET['vertrag_id']))
|
||||
{
|
||||
foreach($_GET['vertrag_id'] as $id)
|
||||
|
||||
if (isset($_GET['vertrag_id']))
|
||||
{
|
||||
$params .= '&vertrag_id[]='.urlencode($id);
|
||||
}
|
||||
}
|
||||
if (isset($_GET['version']) && is_numeric($_GET['version']))
|
||||
$version = $_GET['version'];
|
||||
else
|
||||
$version = null;
|
||||
|
||||
$output = (isset($_GET['output'])?$_GET['output']:'odt');
|
||||
|
||||
$rechte = new benutzerberechtigung();
|
||||
$rechte->getBerechtigungen($user);
|
||||
|
||||
//OE fuer Output ermitteln
|
||||
|
||||
if ($xsl_oe_kurzbz != '')
|
||||
{
|
||||
$oe_kurzbz = $xsl_oe_kurzbz;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($xsl_stg_kz == '')
|
||||
$xsl_stg_kz = '0';
|
||||
$oe = new studiengang();
|
||||
$oe->load($xsl_stg_kz);
|
||||
$oe_kurzbz = $oe->oe_kurzbz;
|
||||
}
|
||||
|
||||
//Darf der User Dokumente in einem NICHT-PDF-Format exportieren?
|
||||
if (isset($_GET['output']) && $_GET['output'] != 'pdf')
|
||||
{
|
||||
if (!$rechte->isBerechtigt('system/change_outputformat',$oe_kurzbz))
|
||||
{
|
||||
$output = 'pdf';
|
||||
foreach($_GET['vertrag_id'] as $id)
|
||||
{
|
||||
$params .= '&vertrag_id[]='.urlencode($id);
|
||||
}
|
||||
}
|
||||
if (isset($_GET['version']) && is_numeric($_GET['version']))
|
||||
$version = $_GET['version'];
|
||||
else
|
||||
$output = $_GET['output'];
|
||||
}
|
||||
else
|
||||
$output = 'pdf';
|
||||
|
||||
$vorlage = new vorlage();
|
||||
if(!$vorlage->loadVorlage($xsl))
|
||||
die('Vorlage wurde nicht gefunden');
|
||||
|
||||
//Berechtigung pruefen
|
||||
if ($xsl == 'AccountInfo')
|
||||
{
|
||||
$isberechtigt = false;
|
||||
|
||||
$uids = explode(';',$_GET['uid']);
|
||||
foreach ($uids as $uid)
|
||||
{
|
||||
//Berechtigung fuer das Drucken des Accountinfoblattes pruefen
|
||||
$ma = new mitarbeiter();
|
||||
if($ma->load($uid))
|
||||
{
|
||||
//Mitarbeiterrechte erforderlich
|
||||
if ($rechte->isBerechtigt('admin', 0, 'suid') || $rechte->isBerechtigt('mitarbeiter', 0, 'suid'))
|
||||
{
|
||||
$isberechtigt = true;
|
||||
}
|
||||
}
|
||||
|
||||
$stud = new student();
|
||||
if ($stud->load($uid))
|
||||
{
|
||||
//Rechte pruefen
|
||||
if ($rechte->isBerechtigt('admin', $stud->studiengang_kz, 'suid') ||
|
||||
$rechte->isBerechtigt('admin', 0, 'suid') ||
|
||||
$rechte->isBerechtigt('assistenz', $stud->studiengang_kz, 'suid') ||
|
||||
$rechte->isBerechtigt('assistenz', 0, 'suid') ||
|
||||
$rechte->isBerechtigt('support', 0, 'suid'))
|
||||
{
|
||||
$isberechtigt=true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!$isberechtigt)
|
||||
{
|
||||
echo 'Sie haben keine Berechtigung um dieses AccountInfoBlatt zu drucken';
|
||||
exit;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$vorlagestudiengang = new vorlage();
|
||||
$version = null;
|
||||
|
||||
$output = (isset($_GET['output'])?$_GET['output']:'odt');
|
||||
|
||||
$rechte = new benutzerberechtigung();
|
||||
$rechte->getBerechtigungen($user);
|
||||
|
||||
//OE fuer Output ermitteln
|
||||
|
||||
if ($xsl_oe_kurzbz != '')
|
||||
{
|
||||
$vorlagestudiengang->getAktuelleVorlage($xsl_oe_kurzbz, $xsl, $version);
|
||||
$oe_kurzbz = $xsl_oe_kurzbz;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($xsl_stg_kz == '')
|
||||
$xsl_stg_kz = '0';
|
||||
|
||||
$vorlagestudiengang->getAktuelleVorlage($xsl_stg_kz, $xsl, $version);
|
||||
$oe = new studiengang();
|
||||
$oe->load($xsl_stg_kz);
|
||||
$oe_kurzbz = $oe->oe_kurzbz;
|
||||
}
|
||||
// Wenn Berechtigung direkt beim der Vorlage angegeben ist
|
||||
if (count($vorlagestudiengang->berechtigung)>0)
|
||||
|
||||
//Darf der User Dokumente in einem NICHT-PDF-Format exportieren?
|
||||
if (isset($_GET['output']) && $_GET['output'] != 'pdf')
|
||||
{
|
||||
$allowed = false;
|
||||
foreach($vorlagestudiengang->berechtigung as $berechtigung_kurzbz)
|
||||
if (!$rechte->isBerechtigt('system/change_outputformat',$oe_kurzbz))
|
||||
{
|
||||
if ($rechte->isBerechtigt($berechtigung_kurzbz))
|
||||
$allowed = true;
|
||||
$output = 'pdf';
|
||||
}
|
||||
if (!$allowed)
|
||||
else
|
||||
$output = $_GET['output'];
|
||||
}
|
||||
else
|
||||
$output = 'pdf';
|
||||
|
||||
$vorlage = new vorlage();
|
||||
if(!$vorlage->loadVorlage($xsl))
|
||||
die('Vorlage wurde nicht gefunden');
|
||||
|
||||
//Berechtigung pruefen
|
||||
if ($xsl == 'AccountInfo')
|
||||
{
|
||||
$isberechtigt = false;
|
||||
|
||||
$uids = explode(';',$_GET['uid']);
|
||||
foreach ($uids as $uid)
|
||||
{
|
||||
echo 'unbekanntes Dokument oder keine Berechtigung';
|
||||
//Berechtigung fuer das Drucken des Accountinfoblattes pruefen
|
||||
$ma = new mitarbeiter();
|
||||
if($ma->load($uid))
|
||||
{
|
||||
//Mitarbeiterrechte erforderlich
|
||||
if ($rechte->isBerechtigt('admin', 0, 'suid') || $rechte->isBerechtigt('mitarbeiter', 0, 'suid'))
|
||||
{
|
||||
$isberechtigt = true;
|
||||
}
|
||||
}
|
||||
|
||||
$stud = new student();
|
||||
if ($stud->load($uid))
|
||||
{
|
||||
//Rechte pruefen
|
||||
if ($rechte->isBerechtigt('admin', $stud->studiengang_kz, 'suid') ||
|
||||
$rechte->isBerechtigt('admin', 0, 'suid') ||
|
||||
$rechte->isBerechtigt('assistenz', $stud->studiengang_kz, 'suid') ||
|
||||
$rechte->isBerechtigt('assistenz', 0, 'suid') ||
|
||||
$rechte->isBerechtigt('support', 0, 'suid'))
|
||||
{
|
||||
$isberechtigt=true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!$isberechtigt)
|
||||
{
|
||||
echo 'Sie haben keine Berechtigung um dieses AccountInfoBlatt zu drucken';
|
||||
exit;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo 'unbekanntes Dokument oder keine Berechtigung';
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
//wenn uid gefunden wird, dann den Nachnamen zum Dateinamen dazuhaengen
|
||||
$nachname = '';
|
||||
if (isset($_GET['uid']) && $_GET['uid']!='')
|
||||
{
|
||||
$uid = str_replace(';','',$_GET['uid']);
|
||||
$benutzer_obj = new benutzer();
|
||||
if ($benutzer_obj->load($uid))
|
||||
$nachname = '_'.convertProblemChars($benutzer_obj->nachname);
|
||||
|
||||
}
|
||||
$filename = $xsl.$nachname;
|
||||
|
||||
if ($xsl_oe_kurzbz == '')
|
||||
{
|
||||
if ($xsl_stg_kz == '')
|
||||
$xsl_stg_kz = '0';
|
||||
$stg_obj = new studiengang();
|
||||
if (!$stg_obj->load($xsl_stg_kz))
|
||||
die($stg_obj->errormsg);
|
||||
$xsl_oe_kurzbz = $stg_obj->oe_kurzbz;
|
||||
}
|
||||
|
||||
if($sign === true && $vorlage->signierbar === false)
|
||||
{
|
||||
die('Diese Vorlage darf nicht signiert werden');
|
||||
}
|
||||
|
||||
if (!isset($_REQUEST["archive"]))
|
||||
{
|
||||
if (mb_strstr($vorlage->mimetype, 'application/vnd.oasis.opendocument'))
|
||||
{
|
||||
$dokument = new dokument_export($xsl, $xsl_oe_kurzbz, $version);
|
||||
$dokument->addDataURL($xml, $params);
|
||||
|
||||
/**
|
||||
* Get Filename
|
||||
* TODO cleanup
|
||||
*/
|
||||
if ($vorlage->bezeichnung!='')
|
||||
$filename = $vorlage->bezeichnung.$nachname;
|
||||
else
|
||||
$filename = $vorlage->vorlage_kurzbz.$nachname;
|
||||
|
||||
switch($xsl)
|
||||
$vorlagestudiengang = new vorlage();
|
||||
if ($xsl_oe_kurzbz != '')
|
||||
{
|
||||
case 'LV_Informationen':
|
||||
$studiengang = new studiengang($_GET['stg_kz']);
|
||||
$studiensemester = new studiensemester($_GET['ss']);
|
||||
$filename = $filename.'_'.$studiengang->kurzbzlang.'_'.$studiensemester->studiensemester_kurzbz;
|
||||
break;
|
||||
case 'Honorarvertrag':
|
||||
$filename = $filename.'_'.$benutzer_obj->nachname.'_'.$benutzer_obj->vorname;
|
||||
break;
|
||||
case 'Studienordnung':
|
||||
$studienordnung = new studienordnung();
|
||||
$studienordnung->loadStudienordnung($_GET['studienordnung_id']);
|
||||
$filename = 'Studienordnung-Studienplan-'. sprintf("%'.04d",$studienordnung->studiengang_kz).'-'.$studienordnung->studiengangkurzbzlang;
|
||||
break;
|
||||
$vorlagestudiengang->getAktuelleVorlage($xsl_oe_kurzbz, $xsl, $version);
|
||||
}
|
||||
|
||||
$dokument->setFilename($filename);
|
||||
|
||||
if ($sign === true)
|
||||
{
|
||||
$dokument->sign($user);
|
||||
}
|
||||
|
||||
if ($dokument->create($output))
|
||||
$dokument->output();
|
||||
else
|
||||
echo $dokument->errormsg;
|
||||
|
||||
$dokument->close();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!$vorlage->archivierbar)
|
||||
die('Dieses Dokument ist nicht archivierbar');
|
||||
|
||||
// Archivieren von Dokumenten
|
||||
$uid = $_REQUEST["uid"];
|
||||
$heute = date('Y-m-d');
|
||||
|
||||
$student = new student();
|
||||
$student->load($uid);
|
||||
|
||||
if (isset($_REQUEST['ss']))
|
||||
{
|
||||
$ss = $_REQUEST["ss"];
|
||||
|
||||
$prestudent = new prestudent();
|
||||
$prestudent->getLastStatus($student->prestudent_id,$ss);
|
||||
$semester = $prestudent->ausbildungssemester;
|
||||
|
||||
$query = "SELECT
|
||||
tbl_studiengang.studiengang_kz, tbl_studentlehrverband.semester, tbl_studiengang.typ,
|
||||
tbl_studiengang.kurzbz, tbl_person.person_id FROM tbl_person, tbl_benutzer,
|
||||
tbl_studentlehrverband, tbl_studiengang
|
||||
WHERE
|
||||
tbl_studentlehrverband.student_uid = tbl_benutzer.uid
|
||||
AND tbl_benutzer.person_id = tbl_person.person_id
|
||||
AND tbl_studentlehrverband.studiengang_kz = tbl_studiengang.studiengang_kz
|
||||
AND tbl_studentlehrverband.student_uid = ".$db->db_add_param($uid)."
|
||||
AND tbl_studentlehrverband.studiensemester_kurzbz = ".$db->db_add_param($ss);
|
||||
|
||||
if ($result = $db->db_query($query))
|
||||
{
|
||||
if ($row = $db->db_fetch_object($result))
|
||||
if ($xsl_stg_kz == '')
|
||||
$xsl_stg_kz = '0';
|
||||
|
||||
$vorlagestudiengang->getAktuelleVorlage($xsl_stg_kz, $xsl, $version);
|
||||
}
|
||||
// Wenn Berechtigung direkt beim der Vorlage angegeben ist
|
||||
if (count($vorlagestudiengang->berechtigung)>0)
|
||||
{
|
||||
$allowed = false;
|
||||
foreach($vorlagestudiengang->berechtigung as $berechtigung_kurzbz)
|
||||
{
|
||||
$person_id = $row->person_id;
|
||||
$titel = $xsl."_".strtoupper($row->typ).strtoupper($row->kurzbz)."_".$semester;
|
||||
$bezeichnung = $xsl." ".strtoupper($row->typ).strtoupper($row->kurzbz)." ".$semester.". Semester";
|
||||
$studiengang_kz = $row->studiengang_kz;
|
||||
if ($rechte->isBerechtigt($berechtigung_kurzbz))
|
||||
$allowed = true;
|
||||
}
|
||||
if (!$allowed)
|
||||
{
|
||||
echo 'unbekanntes Dokument oder keine Berechtigung';
|
||||
exit;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo 'unbekanntes Dokument oder keine Berechtigung';
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
//wenn uid gefunden wird, dann den Nachnamen zum Dateinamen dazuhaengen
|
||||
$nachname = '';
|
||||
if (isset($_GET['uid']) && $_GET['uid']!='')
|
||||
{
|
||||
$uid = str_replace(';','',$_GET['uid']);
|
||||
$benutzer_obj = new benutzer();
|
||||
if ($benutzer_obj->load($uid))
|
||||
$nachname = '_'.convertProblemChars($benutzer_obj->nachname);
|
||||
|
||||
}
|
||||
$filename = $xsl.$nachname;
|
||||
|
||||
if ($xsl_oe_kurzbz == '')
|
||||
{
|
||||
if ($xsl_stg_kz == '')
|
||||
$xsl_stg_kz = '0';
|
||||
$stg_obj = new studiengang();
|
||||
if (!$stg_obj->load($xsl_stg_kz))
|
||||
die($stg_obj->errormsg);
|
||||
$xsl_oe_kurzbz = $stg_obj->oe_kurzbz;
|
||||
}
|
||||
|
||||
if($sign === true && $vorlage->signierbar === false)
|
||||
{
|
||||
die('Diese Vorlage darf nicht signiert werden');
|
||||
}
|
||||
|
||||
if (!isset($_REQUEST["archive"]))
|
||||
{
|
||||
if (mb_strstr($vorlage->mimetype, 'application/vnd.oasis.opendocument'))
|
||||
{
|
||||
$dokument = new dokument_export($xsl, $xsl_oe_kurzbz, $version);
|
||||
$dokument->addDataURL($xml, $params);
|
||||
|
||||
/**
|
||||
* Get Filename
|
||||
* TODO cleanup
|
||||
*/
|
||||
if ($vorlage->bezeichnung!='')
|
||||
$filename = $vorlage->bezeichnung.$nachname;
|
||||
else
|
||||
$filename = $vorlage->vorlage_kurzbz.$nachname;
|
||||
|
||||
switch($xsl)
|
||||
{
|
||||
die('Student hat keinen Status in diesem Semester');
|
||||
case 'LV_Informationen':
|
||||
$studiengang = new studiengang($_GET['stg_kz']);
|
||||
$studiensemester = new studiensemester($_GET['ss']);
|
||||
$filename = $filename.'_'.$studiengang->kurzbzlang.'_'.$studiensemester->studiensemester_kurzbz;
|
||||
break;
|
||||
case 'Honorarvertrag':
|
||||
$filename = $filename.'_'.$benutzer_obj->nachname.'_'.$benutzer_obj->vorname;
|
||||
break;
|
||||
case 'Studienordnung':
|
||||
$studienordnung = new studienordnung();
|
||||
$studienordnung->loadStudienordnung($_GET['studienordnung_id']);
|
||||
$filename = 'Studienordnung-Studienplan-'. sprintf("%'.04d",$studienordnung->studiengang_kz).'-'.$studienordnung->studiengangkurzbzlang;
|
||||
break;
|
||||
}
|
||||
|
||||
$dokument->setFilename($filename);
|
||||
|
||||
if ($sign === true)
|
||||
{
|
||||
$dokument->sign($user);
|
||||
}
|
||||
|
||||
if ($dokument->create($output))
|
||||
$dokument->output();
|
||||
else
|
||||
echo $dokument->errormsg;
|
||||
|
||||
$dokument->close();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$studiengang = new studiengang();
|
||||
$studiengang->load($student->studiengang_kz);
|
||||
$studiengang_kz=$student->studiengang_kz;
|
||||
$person_id = $student->person_id;
|
||||
$titel = $vorlage->bezeichnung.'_'.$studiengang->kuerzel;
|
||||
$bezeichnung = $vorlage->bezeichnung.'_'.$studiengang->kuerzel;
|
||||
}
|
||||
|
||||
if ($rechte->isBerechtigt('admin', $studiengang_kz, 'suid')
|
||||
|| $rechte->isBerechtigt('assistenz', $studiengang_kz, 'suid'))
|
||||
{
|
||||
$dokument = new dokument_export($xsl, $xsl_oe_kurzbz, $version);
|
||||
$dokument->addDataURL($xml, $params);
|
||||
|
||||
$dokument->setFilename($filename);
|
||||
|
||||
$error = false;
|
||||
|
||||
// Beim Archivieren wird das Dokument immer signiert wenn moeglich
|
||||
if($vorlage->signierbar)
|
||||
$sign = true;
|
||||
|
||||
if ($sign === true)
|
||||
if(!$vorlage->archivierbar)
|
||||
die('Dieses Dokument ist nicht archivierbar');
|
||||
|
||||
// Archivieren von Dokumenten
|
||||
$uid = $_REQUEST["uid"];
|
||||
$heute = date('Y-m-d');
|
||||
|
||||
$student = new student();
|
||||
$student->load($uid);
|
||||
|
||||
if (isset($_REQUEST['ss']))
|
||||
{
|
||||
$dokument->sign($user);
|
||||
$ss = $_REQUEST["ss"];
|
||||
|
||||
$prestudent = new prestudent();
|
||||
$prestudent->getLastStatus($student->prestudent_id,$ss);
|
||||
$semester = $prestudent->ausbildungssemester;
|
||||
|
||||
$query = "SELECT
|
||||
tbl_studiengang.studiengang_kz, tbl_studentlehrverband.semester, tbl_studiengang.typ,
|
||||
tbl_studiengang.kurzbz, tbl_person.person_id FROM tbl_person, tbl_benutzer,
|
||||
tbl_studentlehrverband, tbl_studiengang
|
||||
WHERE
|
||||
tbl_studentlehrverband.student_uid = tbl_benutzer.uid
|
||||
AND tbl_benutzer.person_id = tbl_person.person_id
|
||||
AND tbl_studentlehrverband.studiengang_kz = tbl_studiengang.studiengang_kz
|
||||
AND tbl_studentlehrverband.student_uid = ".$db->db_add_param($uid)."
|
||||
AND tbl_studentlehrverband.studiensemester_kurzbz = ".$db->db_add_param($ss);
|
||||
|
||||
if ($result = $db->db_query($query))
|
||||
{
|
||||
if ($row = $db->db_fetch_object($result))
|
||||
{
|
||||
$person_id = $row->person_id;
|
||||
$titel = $xsl."_".strtoupper($row->typ).strtoupper($row->kurzbz)."_".$semester;
|
||||
$bezeichnung = $xsl." ".strtoupper($row->typ).strtoupper($row->kurzbz)." ".$semester.". Semester";
|
||||
$studiengang_kz = $row->studiengang_kz;
|
||||
}
|
||||
else
|
||||
{
|
||||
die('Student hat keinen Status in diesem Semester');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($dokument->create($output))
|
||||
$doc = $dokument->output(false);
|
||||
else
|
||||
{
|
||||
$errormsg = $dokument->errormsg;
|
||||
$error = true;
|
||||
$studiengang = new studiengang();
|
||||
$studiengang->load($student->studiengang_kz);
|
||||
$studiengang_kz=$student->studiengang_kz;
|
||||
$person_id = $student->person_id;
|
||||
$titel = $vorlage->bezeichnung.'_'.$studiengang->kuerzel;
|
||||
$bezeichnung = $vorlage->bezeichnung.'_'.$studiengang->kuerzel;
|
||||
}
|
||||
|
||||
$dokument->close();
|
||||
|
||||
if(!$error)
|
||||
|
||||
if ($rechte->isBerechtigt('admin', $studiengang_kz, 'suid')
|
||||
|| $rechte->isBerechtigt('assistenz', $studiengang_kz, 'suid'))
|
||||
{
|
||||
$hex = base64_encode($doc);
|
||||
$akte = new akte();
|
||||
$akte->person_id = $person_id;
|
||||
if($vorlage->dokument_kurzbz!='')
|
||||
$akte->dokument_kurzbz = $vorlage->dokument_kurzbz;
|
||||
else
|
||||
$akte->dokument_kurzbz = 'Zeugnis';
|
||||
$akte->inhalt = $hex;
|
||||
$akte->mimetype = 'application/pdf';
|
||||
$akte->erstelltam = $heute;
|
||||
$akte->gedruckt = true;
|
||||
$akte->titel = $titel.'.pdf';
|
||||
$akte->bezeichnung = $bezeichnung;
|
||||
$akte->updateamum = '';
|
||||
$akte->updatevon = '';
|
||||
$akte->insertamum = date('Y-m-d H:i:s');
|
||||
$akte->insertvon = $user;
|
||||
$akte->ext_id = '';
|
||||
$akte->uid = $uid;
|
||||
$akte->new = true;
|
||||
$akte->archiv = true;
|
||||
$akte->signiert = $sign;
|
||||
$akte->stud_selfservice = $vorlage->stud_selfservice;
|
||||
|
||||
if (!$akte->save())
|
||||
$dokument = new dokument_export($xsl, $xsl_oe_kurzbz, $version);
|
||||
$dokument->addDataURL($xml, $params);
|
||||
|
||||
$dokument->setFilename($filename);
|
||||
|
||||
$error = false;
|
||||
|
||||
// Beim Archivieren wird das Dokument immer signiert wenn moeglich
|
||||
if($vorlage->signierbar)
|
||||
$sign = true;
|
||||
|
||||
if ($sign === true)
|
||||
{
|
||||
echo 'Erstellen Fehlgeschlagen: '.$akte->errormsg;
|
||||
$dokument->sign($user);
|
||||
}
|
||||
|
||||
if ($dokument->create($output))
|
||||
$doc = $dokument->output(false);
|
||||
else
|
||||
{
|
||||
$errormsg = $dokument->errormsg;
|
||||
$error = true;
|
||||
}
|
||||
|
||||
$dokument->close();
|
||||
|
||||
if(!$error)
|
||||
{
|
||||
$hex = base64_encode($doc);
|
||||
$akte = new akte();
|
||||
$akte->person_id = $person_id;
|
||||
if($vorlage->dokument_kurzbz!='')
|
||||
$akte->dokument_kurzbz = $vorlage->dokument_kurzbz;
|
||||
else
|
||||
$akte->dokument_kurzbz = 'Zeugnis';
|
||||
$akte->inhalt = $hex;
|
||||
$akte->mimetype = 'application/pdf';
|
||||
$akte->erstelltam = $heute;
|
||||
$akte->gedruckt = true;
|
||||
$akte->titel = $titel.'.pdf';
|
||||
$akte->bezeichnung = $bezeichnung;
|
||||
$akte->updateamum = '';
|
||||
$akte->updatevon = '';
|
||||
$akte->insertamum = date('Y-m-d H:i:s');
|
||||
$akte->insertvon = $user;
|
||||
$akte->ext_id = '';
|
||||
$akte->uid = $uid;
|
||||
$akte->new = true;
|
||||
$akte->archiv = true;
|
||||
$akte->signiert = $sign;
|
||||
$akte->stud_selfservice = $vorlage->stud_selfservice;
|
||||
|
||||
if (!$akte->save())
|
||||
{
|
||||
echo 'Erstellen Fehlgeschlagen: '.$akte->errormsg;
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo $errormsg;
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo $errormsg;
|
||||
return false;
|
||||
}
|
||||
echo 'Keine Berechtigung zum Speichern';
|
||||
}
|
||||
else
|
||||
echo 'Keine Berechtigung zum Speichern';
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -75,6 +75,11 @@ else
|
||||
<menuitem label="Student aus dieser Gruppe entfernen" oncommand="StudentGruppeDel();" id="student-tree-popup-gruppedel" hidden="false"/>
|
||||
<menuitem label="EMail senden (intern)" oncommand="StudentSendMail(event);" id="student-tree-popup-mail" hidden="false" tooltiptext="STRG-Taste fuer BCC" />
|
||||
<menuitem label="EMail senden (privat)" oncommand="StudentSendMailPrivat();" id="student-tree-popup-mailprivat" hidden="false"/>
|
||||
<menu id="student-tree-popup-export-archiv" label="Archivdokument exportieren">
|
||||
<menupopup id="student-tree-popup-export-popup">
|
||||
<menuitem label="Bescheid" oncommand="StudentExportBescheid();" id="student-tree-popup-export-bescheid" hidden="false"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
<menuseparator />
|
||||
<menuitem label="Personendetails anzeigen" oncommand="StudentShowPersonendetails();" id="student-tree-popup-personendetails" hidden="false"/>
|
||||
<!--
|
||||
|
||||
@@ -5575,3 +5575,40 @@ function StudentLVGesamtNotenTreeSort()
|
||||
// da sonst nach dem sortieren falsche Eintraege markiert sind
|
||||
window.setTimeout(StudentNotenTreeSelectDifferent,20);
|
||||
}
|
||||
|
||||
//****
|
||||
//* Exportiert den Bescheid fuer alle markierten Studierenden
|
||||
//****
|
||||
function StudentExportBescheid()
|
||||
{
|
||||
|
||||
tree = document.getElementById('student-tree');
|
||||
//Alle markierten Studenten holen
|
||||
var start = new Object();
|
||||
var end = new Object();
|
||||
var numRanges = tree.view.selection.getRangeCount();
|
||||
var paramList= '';
|
||||
var anzahl=0;
|
||||
|
||||
for (var t = 0; t < numRanges; t++)
|
||||
{
|
||||
tree.view.selection.getRangeAt(t,start,end);
|
||||
for (var v = start.value; v <= end.value; v++)
|
||||
{
|
||||
uid = getTreeCellText(tree, 'student-treecol-uid', v);
|
||||
paramList += ';'+uid;
|
||||
anzahl = anzahl+1;
|
||||
}
|
||||
}
|
||||
|
||||
if(paramList.replace(";",'') == '')
|
||||
{
|
||||
alert('Bitte einen Studenten auswaehlen');
|
||||
return false;
|
||||
}
|
||||
|
||||
if(anzahl>0)
|
||||
window.open('<?php echo APP_ROOT; ?>content/pdfExport.php?archivdokument=Bescheid&uid='+paramList,'Bescheide', 'height=200,width=350,left=0,top=0,hotkeys=0,resizable=yes,status=no,scrollbars=yes,toolbar=no,location=no,menubar=no,dependent=yes');
|
||||
else
|
||||
alert('Bitte einen Studenten auswaehlen');
|
||||
}
|
||||
|
||||
@@ -1098,7 +1098,7 @@ function StudentProjektbetreuerLoadMitarbeiterDaten()
|
||||
// ****
|
||||
function StudentProjektbetreuerNeuePerson()
|
||||
{
|
||||
window.open('<?php echo APP_ROOT; ?>vilesci/personen/personen_anlegen.php','Person anlegen','height=600,width=900,left=300,top=300,hotkeys=0,resizable=yes,status=no,toolbar=no,location=no,menubar=no,dependent=yes');
|
||||
window.open('<?php echo APP_ROOT; ?>vilesci/personen/personen_anlegen.php','Person anlegen','height=700,width=900,left=300,top=300,hotkeys=0,resizable=yes,status=no,toolbar=no,location=no,menubar=no,dependent=yes');
|
||||
}
|
||||
|
||||
// ****
|
||||
|
||||
+13
-5
@@ -297,16 +297,21 @@ class akte extends basis_db
|
||||
* @param $stg_kz -> wenn gesetzt werden nur Akten angezeigt die ZUSÄTZLICH zum Studiengang abgegeben worden sind ohne Zeugnis
|
||||
* @param $prestudent_id -> gesetzt wenn auch stg_kz gesetzt ist um sicherzugehen, dass Akten, die er schon für seinen Studiengang abgegeben hat,
|
||||
* nicht mehr angezeigt werden
|
||||
* @param boolean $returnInhalt Wenn true, wird auch den Inhalt (base64-Code) geladen, sonst nur allgemeine Informationen
|
||||
* @param string $order Sortierreihenfolge im SQL
|
||||
* @return true wenn ok, sonst false
|
||||
*/
|
||||
public function getAkten($person_id, $dokument_kurzbz=null, $stg_kz = null, $prestudent_id = null)
|
||||
public function getAkten($person_id, $dokument_kurzbz=null, $stg_kz = null, $prestudent_id = null, $returnInhalt = false, $order = 'erstelltam')
|
||||
{
|
||||
$qry = "SELECT
|
||||
akte_id, person_id, dokument_kurzbz, mimetype, erstelltam, gedruckt, titel_intern, anmerkung_intern,
|
||||
titel, bezeichnung, updateamum, insertamum, updatevon, insertvon, uid, dms_id, anmerkung, nachgereicht,
|
||||
CASE WHEN inhalt is not null THEN true ELSE false END as inhalt_vorhanden,
|
||||
nachgereicht_am, ausstellungsnation, formal_geprueft_amum, archiv, signiert, stud_selfservice
|
||||
FROM public.tbl_akte WHERE person_id=".$this->db_add_param($person_id, FHC_INTEGER);
|
||||
nachgereicht_am, ausstellungsnation, formal_geprueft_amum, archiv, signiert, stud_selfservice";
|
||||
if($returnInhalt === true)
|
||||
$qry.=",inhalt ";
|
||||
|
||||
$qry.=" FROM public.tbl_akte WHERE person_id=".$this->db_add_param($person_id, FHC_INTEGER);
|
||||
if($dokument_kurzbz!=null)
|
||||
$qry.=" AND dokument_kurzbz=".$this->db_add_param($dokument_kurzbz);
|
||||
if($stg_kz != null && $prestudent_id != null)
|
||||
@@ -315,7 +320,8 @@ class akte extends basis_db
|
||||
(SELECT dokument_kurzbz FROM public.tbl_dokumentprestudent JOIN public.tbl_dokument USING(dokument_kurzbz)
|
||||
WHERE prestudent_id=".$this->db_add_param($prestudent_id).")";
|
||||
|
||||
$qry.=" ORDER BY erstelltam";
|
||||
if ($order != '')
|
||||
$qry.=" ORDER BY ".$order;
|
||||
|
||||
$this->errormsg = $qry;
|
||||
|
||||
@@ -328,7 +334,9 @@ class akte extends basis_db
|
||||
$akten->akte_id = $row->akte_id;
|
||||
$akten->person_id = $row->person_id;
|
||||
$akten->dokument_kurzbz = $row->dokument_kurzbz;
|
||||
//$akte->inhalt = $row->inhalt;
|
||||
if($returnInhalt === true)
|
||||
$akten->inhalt = $row->inhalt;
|
||||
|
||||
$akten->inhalt_vorhanden = $this->db_parse_bool($row->inhalt_vorhanden);
|
||||
$akten->mimetype = $row->mimetype;
|
||||
$akten->erstelltam = $row->erstelltam;
|
||||
|
||||
@@ -102,12 +102,18 @@ class benutzerfunktion extends basis_db
|
||||
|
||||
/**
|
||||
* Prueft ob der Benutzer $uid die
|
||||
* Funktion $benutzerfunktion hat
|
||||
* Funktion $benutzerfunktion hat. Der optionale Parameter $gueltig prüft zusätzlich auf das Gültigkeitsdatum.
|
||||
* @param string $uid
|
||||
* @param string $benutzerfunktion
|
||||
* @param boolean $gueltig. Default=false. Wenn true, wird zusätzlich das Gültigkeitsdatum geprüft
|
||||
*/
|
||||
public function benutzerfunktion_exists($uid, $benutzerfunktion)
|
||||
public function benutzerfunktion_exists($uid, $benutzerfunktion, $gueltig = false)
|
||||
{
|
||||
$qry = "SELECT count(*) as anzahl FROM public.tbl_benutzerfunktion
|
||||
WHERE uid=".$this->db_add_param($uid)." AND funktion_kurzbz=".$this->db_add_param($benutzerfunktion);
|
||||
|
||||
if ($gueltig = TRUE)
|
||||
$qry .= ' AND (datum_von IS NULL OR datum_von <= now()) AND (datum_bis IS NULL OR datum_bis >= now()) ';
|
||||
|
||||
if($row = $this->db_fetch_object($this->db_query($qry)))
|
||||
{
|
||||
|
||||
@@ -832,16 +832,21 @@ class dokument extends basis_db
|
||||
|
||||
if($result = $this->db_query($qry))
|
||||
{
|
||||
$stg_obj = new basis_db();
|
||||
while($row = $this->db_fetch_object($result))
|
||||
if ($this->db_num_rows($result) > 0)
|
||||
{
|
||||
$stg_obj->kuerzel = $row->kuerzel;
|
||||
$stg_obj->bezeichnung = $row->bezeichnung;
|
||||
$stg_obj->studiengang_kz = $row->studiengang_kz;
|
||||
|
||||
$this->result[] = $stg_obj;
|
||||
while($row = $this->db_fetch_object($result))
|
||||
{
|
||||
$stg_obj = new basis_db();
|
||||
$stg_obj->kuerzel = $row->kuerzel;
|
||||
$stg_obj->bezeichnung = $row->bezeichnung;
|
||||
$stg_obj->studiengang_kz = $row->studiengang_kz;
|
||||
|
||||
$this->result[] = $stg_obj;
|
||||
}
|
||||
return $stg_obj;
|
||||
}
|
||||
return $stg_obj;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -79,13 +79,18 @@ class personlog extends basis_db
|
||||
}
|
||||
|
||||
/**
|
||||
* Löscht alle Logeinträge vom Typ "Parked" der übergebenen Person_id die in der Zukunft liegen.
|
||||
* Löscht alle Logeinträge vom Typ "Precessstate" mit Namen "Parked" der übergebenen Person_id, die in der Zukunft liegen.
|
||||
* @param integer $person_id ID der Person, deren geparkter Logeintrag gelöscht werden soll.
|
||||
* @return boolean true wenn erfolgreich, false im Fehlerfall.
|
||||
*/
|
||||
public function deleteParked($person_id)
|
||||
{
|
||||
$qry = "DELETE FROM system.tbl_log WHERE logtype_kurzbz='Parked' AND person_id=".$this->db_add_param($person_id)." AND zeitpunkt>=now();";
|
||||
$qry = "DELETE
|
||||
FROM system.tbl_log
|
||||
WHERE logtype_kurzbz = 'Processstate'
|
||||
AND person_id = ".$this->db_add_param($person_id)."
|
||||
AND logdata ->> 'name' = 'Parked'
|
||||
AND zeitpunkt >= now();";
|
||||
|
||||
if($this->db_query($qry))
|
||||
{
|
||||
|
||||
@@ -634,24 +634,37 @@ or not exists
|
||||
FROM
|
||||
lehre.tbl_lehreinheitmitarbeiter m,
|
||||
lehre.tbl_lehreinheit l
|
||||
JOIN
|
||||
lehre.tbl_lehrveranstaltung lv using (lehrveranstaltung_id)
|
||||
JOIN
|
||||
public.tbl_studiengang s using (studiengang_kz)
|
||||
WHERE
|
||||
$where AND
|
||||
$where_sem AND
|
||||
l.lehreinheit_id = m.lehreinheit_id AND
|
||||
m.stundensatz * m.semesterstunden > 0
|
||||
m.stundensatz * m.semesterstunden > 0 AND
|
||||
s.typ not in ('l') AND
|
||||
lv.studiengang_kz > 0
|
||||
UNION
|
||||
SELECT sum(pb.stunden) AS semstunden
|
||||
FROM
|
||||
lehre.tbl_projektarbeit pa,
|
||||
lehre.tbl_projektbetreuer pb,
|
||||
lehre.tbl_lehreinheit l,
|
||||
public.tbl_benutzer b
|
||||
public.tbl_benutzer b,
|
||||
lehre.tbl_lehreinheit l
|
||||
JOIN
|
||||
lehre.tbl_lehrveranstaltung lv using (lehrveranstaltung_id)
|
||||
JOIN
|
||||
public.tbl_studiengang s using (studiengang_kz)
|
||||
|
||||
WHERE
|
||||
pa.lehreinheit_id = l.lehreinheit_id AND
|
||||
pb.projektarbeit_id = pa.projektarbeit_id AND
|
||||
pb.person_id = b.person_id AND
|
||||
b.uid = ".$this->db_add_param($user)." AND
|
||||
pb.stunden * pb.stundensatz > 0 AND
|
||||
s.typ not in ('l') AND
|
||||
lv.studiengang_kz > 0 AND
|
||||
$where_sem
|
||||
) AS semstunden
|
||||
";
|
||||
|
||||
@@ -291,7 +291,7 @@
|
||||
<!ENTITY menu-dokumente-pruefungszeugnis_englisch.label "Prüfungszeugnis Englisch">
|
||||
<!ENTITY menu-dokumente-pruefungszeugnis_englisch.accesskey "G">
|
||||
|
||||
<!ENTITY menu-dokumente-bescheid_deutsch.label "Bescheid Deutsch">
|
||||
<!ENTITY menu-dokumente-bescheid_deutsch.label "Bescheid (Nur Voransicht)">
|
||||
<!ENTITY menu-dokumente-bescheid_deutsch.accesskey "D">
|
||||
|
||||
<!ENTITY menu-dokumente-bescheid_englisch.label "Bescheid Englisch">
|
||||
|
||||
@@ -139,5 +139,15 @@ $this->phrasen['incoming/jahreStudiertMussGanzeZahlSein']='Das Feld "Jahre studi
|
||||
$this->phrasen['incoming/lvVollBelegt']='Es sind mittlerweile keine freien Plätze mehr für diese Lehrveranstaltung verfügbar. Bei Rückfragen kontaktieren Sie bitte <a href="mailto:%s">%s</a>';
|
||||
$this->phrasen['incoming/beginnNichtInVergangenheit']='Das Beginndatum darf nicht in der Vergangenheit liegen';
|
||||
$this->phrasen['incoming/endeGroesserStart']='Das Endedatum darf nicht vor dem Beginndatum liegen';
|
||||
$this->phrasen['incoming/bitteGueltigesDatumEingeben']='Das Start- oder Endedatum muss im Format TT.MM.YYYY vorliegen';
|
||||
$this->phrasen['incoming/bitteGueltigesDatumEingeben']='Das Start- oder Endedatum muss im Format TT.MM.YYYY vorliegen';
|
||||
$this->phrasen['incoming/datenschutzHinweisRegistration']='Datenschutz-Hinweis:<br>
|
||||
Die uns von Ihnen zum Zwecke der Bewerbung bekanntgegebenen Daten werden von uns ausschließlich zur Abwicklung der Bewerbung auf der Grundlage von
|
||||
vor- bzw vertraglichen Zwecken verarbeitet und mit der unten beschriebenen Ausnahme bei Unklarheiten betreffend die Zugangsvoraussetzungen nicht
|
||||
an Dritte weitergegeben. Kommt es zu keinem weiteren Kontakt bzw zu keiner Aufnahme, löschen wir Ihre Daten nach drei Jahren.<br><br>
|
||||
Informationen zu Ihren Betroffenenrechten finden Sie hier: <a href=\'https://www.technikum-wien.at/information-ueber-ihre-rechte-gemaess-datenschutz-grundverordnung/\' target=\'_blank\'>https://www.technikum-wien.at/information-ueber-ihre-rechte-gemaess-datenschutz-grundverordnung/</a><br><br>
|
||||
Bei Fragen stehen wir Ihnen jederzeit unter <a href=\'mailto:datenschutz@technikum-wien.at\'>datenschutz@technikum-wien.at</a> zur Verfügung.<br><br>
|
||||
Verantwortlich für die Datenverarbeitung:<br>
|
||||
Fachhochschule Technikum Wien<br>
|
||||
Höchstädtplatz 6<br>
|
||||
1200 Wien';
|
||||
?>
|
||||
|
||||
@@ -38,25 +38,25 @@ $this->phrasen['profil/zeitsperrenVon']='Zeitsperren von';
|
||||
$this->phrasen['profil/lvplanVon']='LV-Plan von';
|
||||
|
||||
$this->phrasen['profil/AccountInaktiv']='Achtung: Dieser Account ist nicht mehr aktiv';
|
||||
$this->phrasen['profil/inaktivStudent']='Achtung!<br> Wir möchten Sie darauf aufmerksam machen, dass Ihr Benutzerdatensatz
|
||||
$this->phrasen['profil/inaktivStudent']='Achtung!<br> Wir möchten Sie darauf aufmerksam machen, dass Ihr Benutzerdatensatz
|
||||
deaktiviert wurde.Durch diese Deaktivierung wurden Sie auch aus allen Email-Verteilern gelöscht. <br><br>
|
||||
Sollte innerhalb von 6 Monaten (für Studierende) bzw. 3 Wochen (für AbbrecherInnen) nach der Deaktivierung keine
|
||||
Sollte innerhalb von 6 Monaten (für Studierende) bzw. 3 Wochen (für AbbrecherInnen) nach der Deaktivierung keine
|
||||
neuerliche Aktivierung Ihres Benutzerdatensatzes erfolgen, dann werden automatisch auch<br>- Ihr Account, <br>- Ihre Mailbox (inkl. aller E-Mails) und<br>
|
||||
- Ihr Home-Verzeichnis (inkl. aller Dateien) gelöscht.<br><br>Falls es sich bei der Deaktivierung um einen Irrtum handelt, würden wir Sie bitten,
|
||||
- Ihr Home-Verzeichnis (inkl. aller Dateien) gelöscht.<br><br>Falls es sich bei der Deaktivierung um einen Irrtum handelt, würden wir Sie bitten,
|
||||
sich umgehend mit Ihrer Studiengangsassistenz in Verbindung zu setzen.<br>';
|
||||
|
||||
$this->phrasen['profil/inaktivMitarbeiter']='Achtung!<br> Wir möchten Sie darauf aufmerksam machen, dass Ihr Benutzerdatensatz
|
||||
$this->phrasen['profil/inaktivMitarbeiter']='Achtung!<br> Wir möchten Sie darauf aufmerksam machen, dass Ihr Benutzerdatensatz
|
||||
deaktiviert wurde.Durch diese Deaktivierung wurden Sie auch aus allen Email-Verteilern gelöscht. <br><br>
|
||||
Sollte innerhalb von 12 Monaten nach der Deaktivierung keine neuerliche Aktivierung Ihres Benutzerdatensatzes erfolgen, dann werden automatisch auch<br>
|
||||
- Ihr Account, <br>- Ihre Mailbox (inkl. aller E-Mails) und<br>
|
||||
- Ihr Home-Verzeichnis (inkl. aller Dateien) gelöscht.<br><br>Falls es sich bei der Deaktivierung um einen Irrtum handelt, würden wir Sie bitten,
|
||||
- Ihr Home-Verzeichnis (inkl. aller Dateien) gelöscht.<br><br>Falls es sich bei der Deaktivierung um einen Irrtum handelt, würden wir Sie bitten,
|
||||
sich umgehend mit Ihrer Studiengangsassistenz in Verbindung zu setzen.<br>';
|
||||
|
||||
$this->phrasen['profil/inaktivSonstige']='Achtung!<br> Wir möchten Sie darauf aufmerksam machen, dass Ihr Benutzerdatensatz
|
||||
$this->phrasen['profil/inaktivSonstige']='Achtung!<br> Wir möchten Sie darauf aufmerksam machen, dass Ihr Benutzerdatensatz
|
||||
deaktiviert wurde.Durch diese Deaktivierung wurden Sie auch aus allen Email-Verteilern gelöscht. <br><br>
|
||||
Sollte innerhalb der nächsten Tagen keine neuerliche Aktivierung Ihres Benutzerdatensatzes erfolgen, dann werden automatisch auch<br>
|
||||
- Ihr Account, <br>- Ihre Mailbox (inkl. aller E-Mails) und<br>
|
||||
- Ihr Home-Verzeichnis (inkl. aller Dateien) gelöscht.<br><br>Falls es sich bei der Deaktivierung um einen Irrtum handelt, würden wir Sie bitten,
|
||||
- Ihr Home-Verzeichnis (inkl. aller Dateien) gelöscht.<br><br>Falls es sich bei der Deaktivierung um einen Irrtum handelt, würden wir Sie bitten,
|
||||
sich umgehend mit Ihrer Studiengangsassistenz in Verbindung zu setzen.<br>';
|
||||
|
||||
$this->phrasen['profil/nurJPGBilder']='Derzeit können nur Bilder im JPG Format hochgeladen werden';
|
||||
@@ -78,4 +78,6 @@ $this->phrasen['profil/fhausweisWurdeNochNichtGedruckt']='FH-Ausweis wurde noch
|
||||
$this->phrasen['profil/ihrFotoWurdeNochNichtGeprueft']='Ihr Foto wurde noch nicht geprüft';
|
||||
$this->phrasen['profil/fotoAuswählen']='Klicken Sie auf das Bild um ein Foto hochzuladen';
|
||||
$this->phrasen['profil/bildSpeichern']='Bild speichern';
|
||||
$this->phrasen['profil/gueltigvon']='Gültig von';
|
||||
$this->phrasen['profil/gueltigbis']='Gültig bis';
|
||||
?>
|
||||
|
||||
@@ -140,5 +140,13 @@ $this->phrasen['incoming/jahreStudiertMussGanzeZahlSein']='"Years completed" mus
|
||||
$this->phrasen['incoming/lvVollBelegt']='By now there are no vacancies for this course. For further questions please contact <a href="mailto:%s">%s</a>';
|
||||
$this->phrasen['incoming/beginnNichtInVergangenheit']='The "From"-date may not be in the past';
|
||||
$this->phrasen['incoming/endeGroesserStart']='The "To"-date may not be before the start';
|
||||
$this->phrasen['incoming/bitteGueltigesDatumEingeben']='The date for the begin and end must be entered in the DD.MM.YYYY format';
|
||||
$this->phrasen['incoming/bitteGueltigesDatumEingeben']='The date for the begin and end must be entered in the DD.MM.YYYY format';
|
||||
$this->phrasen['incoming/datenschutzHinweisRegistration']='Privacy information:<br>
|
||||
The data communicated to us by you for the purpose of the application will be used by us exclusively for the processing of the application on the basis of pre-contractual or contractual purposes and will not be passed on to third parties with the exception described below in case of uncertainties regarding the entry requirements. If there is no further contact or enrolment, your data will be deleted after three years.<br><br>
|
||||
Information on your data subject rights can be found here: <a href=\'https://www.technikum-wien.at/information-ueber-ihre-rechte-gemaess-datenschutz-grundverordnung/\' target=\'_blank\'>https://www.technikum-wien.at/information-ueber-ihre-rechte-gemaess-datenschutz-grundverordnung/</a><br><br>
|
||||
If you have any questions, please contact us at <a href=\'mailto:datenschutz@technikum-wien.at\'>datenschutz@technikum-wien.at</a><br><br>
|
||||
Data Processing Office:<br>
|
||||
University of Applied Sciences Technikum Wien<br>
|
||||
Höchstädtplatz 6<br>
|
||||
1200 Wien';
|
||||
?>
|
||||
|
||||
@@ -35,19 +35,19 @@ $this->phrasen['profil/zeitsperrenVon']='Unavailabilities of';
|
||||
$this->phrasen['profil/lvplanVon']='Schedule from';
|
||||
|
||||
$this->phrasen['profil/AccountInaktiv']='NOTICE: This account is no longer active';
|
||||
$this->phrasen['profil/inaktivStudent']='NOTICE!<br> We would like to remind you that your user record has been deactivated.
|
||||
$this->phrasen['profil/inaktivStudent']='NOTICE!<br> We would like to remind you that your user record has been deactivated.
|
||||
You were also removed from all e-mail distribution lists when your account was deactivated.<br><br>
|
||||
If your user account is not reactivated within 6 months (for students) or 3 weeks (for dropouts) of being deactivated, the following data will be automatically deleted:<br>
|
||||
- Your account<br>- Your mailbox (including all e-mails) and<br>- Your home directory (including all files).<br><br>
|
||||
If your account has been deactivated by mistake, please contact the administrative assistant for your degree program immediately.<br>';
|
||||
|
||||
$this->phrasen['profil/inaktivMitarbeiter']='NOTICE!<br> We would like to remind you that your user record has been deactivated.
|
||||
$this->phrasen['profil/inaktivMitarbeiter']='NOTICE!<br> We would like to remind you that your user record has been deactivated.
|
||||
You were also removed from all e-mail distribution lists when your account was deactivated.<br><br>
|
||||
If your user account is not reactivated within 12 months of being deactivated, the following data will be automatically deleted:<br>
|
||||
- Your account<br>- Your mailbox (including all e-mails) and<br>- Your home directory (including all files).<br><br>
|
||||
If your account has been deactivated by mistake, please contact the administrative assistant for your degree program immediately.<br>';
|
||||
|
||||
$this->phrasen['profil/inaktivSonstige']='NOTICE!<br> We would like to remind you that your user record has been deactivated.
|
||||
$this->phrasen['profil/inaktivSonstige']='NOTICE!<br> We would like to remind you that your user record has been deactivated.
|
||||
You were also removed from all e-mail distribution lists when your account was deactivated.<br><br>
|
||||
If your user account is not reactivated within the next days of being deactivated, the following data will be automatically deleted:<br>
|
||||
- Your account<br>- Your mailbox (including all e-mails) and<br>- Your home directory (including all files).<br><br>
|
||||
@@ -75,4 +75,6 @@ $this->phrasen['profil/fhausweisWurdeNochNichtGedruckt']='UAS ID card has not ye
|
||||
$this->phrasen['profil/ihrFotoWurdeNochNichtGeprueft']='Your photo has not yet been approved';
|
||||
$this->phrasen['profil/fotoAuswählen']='Click on the image below to upload a photo';
|
||||
$this->phrasen['profil/bildSpeichern']='Save image';
|
||||
$this->phrasen['profil/gueltigvon']='Valid from';
|
||||
$this->phrasen['profil/gueltigbis']='Valid to';
|
||||
?>
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
.veil {
|
||||
position: absolute;
|
||||
z-index: 9999;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
background-color: white;
|
||||
border-width: 0px;
|
||||
background-image: url("../images/loader.gif");
|
||||
background-repeat: no-repeat;
|
||||
background-position: center;
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
.filter-name-title {
|
||||
font-family: inherit;
|
||||
font-size: 16px;
|
||||
line-height: 1.1;
|
||||
color: black;
|
||||
}
|
||||
|
||||
.panel-title {
|
||||
font-weight: bold;
|
||||
padding-top: 3px;
|
||||
}
|
||||
|
||||
.filters-hidden-panel {
|
||||
margin: 0 10px 10px 10px;
|
||||
}
|
||||
|
||||
.filter-span-label {
|
||||
display: inline-block;
|
||||
width: 200px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.drag-and-drop-fields-area {
|
||||
height: 50px;
|
||||
}
|
||||
|
||||
.drag-and-drop-fields-span {
|
||||
border: 1px solid black;
|
||||
border-radius: 7px;
|
||||
margin-left: 3px;
|
||||
margin-right: 3px;
|
||||
padding: 10px;
|
||||
top: 10px;
|
||||
}
|
||||
|
||||
.drag-and-drop-fields-span:hover {
|
||||
cursor: move;
|
||||
}
|
||||
|
||||
.remove-selected-field {
|
||||
font-weight: bold;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.remove-selected-field:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.hidden-control {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.selection-before::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 100%;
|
||||
height: 100%;
|
||||
margin-right: 3px;
|
||||
border-left: 2px solid #428bca;
|
||||
}
|
||||
|
||||
.selection-after::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 100%;
|
||||
height: 100%;
|
||||
margin-left: 3px;
|
||||
border-right: 2px solid #428bca;
|
||||
}
|
||||
|
||||
.applied-filter-operation {
|
||||
display: inline;
|
||||
width: 130px;
|
||||
}
|
||||
|
||||
.applied-filter-condition {
|
||||
display: inline;
|
||||
width: 400px;
|
||||
}
|
||||
|
||||
.applied-filter-option {
|
||||
display: inline;
|
||||
width: 100px;
|
||||
}
|
||||
|
||||
.remove-applied-filter {
|
||||
padding-bottom: 3px;
|
||||
}
|
||||
|
||||
.drop-down-fields, .drop-down-filters, .input-text-custom-filter {
|
||||
display: inline;
|
||||
width: 535px;
|
||||
}
|
||||
|
||||
#appliedFilters {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
#applyFilter, #saveCustomFilterButton, .remove-applied-filter {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#applyFilter, #saveCustomFilterButton {
|
||||
width: 100px;
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
#collapseinicon {
|
||||
display: none;
|
||||
cursor: pointer;
|
||||
color: #337ab7;
|
||||
border-bottom: 1px solid #e7e7e7;
|
||||
border-right: 1px solid #e7e7e7;
|
||||
border-left: 1px solid #e7e7e7;
|
||||
position: absolute;
|
||||
width: 45px;
|
||||
height: 20px;
|
||||
background-color: #F8F8F8;
|
||||
}
|
||||
|
||||
.nav > li > span > a:focus, .nav > li > span > a:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.nav > li > span {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
padding-top: 15px;
|
||||
padding-bottom: 15px;
|
||||
}
|
||||
|
||||
.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;
|
||||
}
|
||||
@@ -23,7 +23,7 @@
|
||||
}
|
||||
|
||||
/*arrow toggle for panels*/
|
||||
.panel-heading .accordion-toggle:before{
|
||||
.panel-heading .accordion-toggle.arrowcollapse:before{
|
||||
/* symbol for "opening" panels */
|
||||
font-family: 'Glyphicons Halflings'; /* essential for enabling glyphicon */
|
||||
content: "\e114"; /* adjust as needed, taken from bootstrap.css */
|
||||
@@ -32,7 +32,7 @@
|
||||
color: grey; /* adjust as needed */
|
||||
}
|
||||
|
||||
.panel-heading .accordion-toggle.collapsed:before{
|
||||
.panel-heading .accordion-toggle.collapsed.arrowcollapse:before{
|
||||
/* symbol for "collapsed" panels */
|
||||
content: "\e080"; /* adjust as needed, taken from bootstrap.css */
|
||||
}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
@@ -0,0 +1,462 @@
|
||||
/**
|
||||
* FH-Complete
|
||||
*
|
||||
* @package
|
||||
* @author
|
||||
* @copyright Copyright (c) 2016 fhcomplete.org
|
||||
* @license GPLv3
|
||||
* @link https://fhcomplete.org
|
||||
* @since Version 1.0.0
|
||||
*/
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------
|
||||
// Configs
|
||||
|
||||
// To see debug messages into the browser console set this parameter as true
|
||||
const DEBUG = false;
|
||||
|
||||
// Default veil timeout (milliseconds)
|
||||
const VEIL_TIMEOUT = 1000;
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------
|
||||
// Constants
|
||||
|
||||
// Success
|
||||
const SUCCESS = 0;
|
||||
|
||||
// Properties present in a response
|
||||
const CODE = "error";
|
||||
const RESPONSE = "retval";
|
||||
|
||||
// HTTP method parameters
|
||||
const HTTP_GET_METHOD = "GET";
|
||||
const HTTP_POST_METHOD = "POST";
|
||||
|
||||
const REMOTE_CONTROLLER = "remoteController";
|
||||
|
||||
const FHC_CONTROLLER_ID = "fhc_controller_id";
|
||||
|
||||
/**
|
||||
* Definition and initialization of object FHC_AjaxClient
|
||||
*/
|
||||
var FHC_AjaxClient = {
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Properties
|
||||
|
||||
_veilCallersCounter: 0, // count the number of callers that want to activate the veil
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* Performs a call using the HTTP GET method
|
||||
* controllerParameters is an object
|
||||
* ajaxCallParameters is an object
|
||||
*/
|
||||
ajaxCallGet: function(remoteController, controllerParameters, ajaxCallParameters) {
|
||||
FHC_AjaxClient._ajaxCall(remoteController, controllerParameters, HTTP_GET_METHOD, ajaxCallParameters);
|
||||
},
|
||||
|
||||
/**
|
||||
* Performs a call using the HTTP POST method
|
||||
* controllerParameters is an object
|
||||
* ajaxCallParameters is an object
|
||||
*/
|
||||
ajaxCallPost: function(remoteController, controllerParameters, ajaxCallParameters) {
|
||||
FHC_AjaxClient._ajaxCall(remoteController, controllerParameters, HTTP_POST_METHOD, ajaxCallParameters);
|
||||
},
|
||||
|
||||
/**
|
||||
* Checks if the response is a success
|
||||
*/
|
||||
isSuccess: function(response) {
|
||||
var isSuccess = false;
|
||||
|
||||
if (jQuery.type(response) == "object" && response.hasOwnProperty(CODE) && response.hasOwnProperty(RESPONSE))
|
||||
{
|
||||
if (response.error == SUCCESS)
|
||||
{
|
||||
isSuccess = true;
|
||||
}
|
||||
}
|
||||
|
||||
return isSuccess;
|
||||
},
|
||||
|
||||
/**
|
||||
* Checks if the response is an error
|
||||
*/
|
||||
isError: function(response) {
|
||||
return !FHC_AjaxClient.isSuccess(response);
|
||||
},
|
||||
|
||||
/**
|
||||
* Checks if the response has data
|
||||
*/
|
||||
hasData: function(response) {
|
||||
var hasData = false;
|
||||
|
||||
if (FHC_AjaxClient.isSuccess(response))
|
||||
{
|
||||
if ((jQuery.type(response.retval) == "object" && !jQuery.isEmptyObject(response.retval))
|
||||
|| (jQuery.isArray(response.retval) && response.retval.length > 0)
|
||||
|| (jQuery.type(response.retval) == "string" && response.retval.trim() != "")
|
||||
|| jQuery.type(response.retval) == "number")
|
||||
{
|
||||
hasData = true;
|
||||
}
|
||||
}
|
||||
|
||||
return hasData;
|
||||
},
|
||||
|
||||
/**
|
||||
* Retrives data from response object
|
||||
*/
|
||||
getData: function(response) {
|
||||
var data = null;
|
||||
|
||||
if (FHC_AjaxClient.hasData(response))
|
||||
{
|
||||
data = response.retval;
|
||||
}
|
||||
|
||||
return data;
|
||||
},
|
||||
|
||||
/**
|
||||
* Retrives error message from response object
|
||||
*/
|
||||
getError: function(response) {
|
||||
var error = 'Generic error';
|
||||
|
||||
if (jQuery.type(response) == "object" && !jQuery.isEmptyObject(response) && response.hasOwnProperty(RESPONSE))
|
||||
{
|
||||
error = response.retval;
|
||||
}
|
||||
|
||||
return error;
|
||||
},
|
||||
|
||||
/**
|
||||
* Retrives code from response object
|
||||
*/
|
||||
getCode: function(response) {
|
||||
var code = 1; // Generic error
|
||||
|
||||
if (jQuery.type(response) == "object" && response.hasOwnProperty(CODE))
|
||||
{
|
||||
if (response.error == SUCCESS)
|
||||
{
|
||||
isSuccess = true;
|
||||
}
|
||||
}
|
||||
|
||||
return code;
|
||||
},
|
||||
|
||||
/**
|
||||
* Show a veil
|
||||
*/
|
||||
showVeil: function(veilTimeout) {
|
||||
if (typeof veilTimeout == "number")
|
||||
{
|
||||
FHC_AjaxClient._veilTimeout = veilTimeout;
|
||||
}
|
||||
else
|
||||
{
|
||||
FHC_AjaxClient._veilTimeout = VEIL_TIMEOUT;
|
||||
}
|
||||
FHC_AjaxClient._showVeil();
|
||||
},
|
||||
|
||||
/**
|
||||
* Hide a veil that was shown before
|
||||
*/
|
||||
hideVeil: function() {
|
||||
FHC_AjaxClient._hideVeil();
|
||||
},
|
||||
|
||||
/**
|
||||
* Retrives parameters from URL query string (HTTP GET parameters)
|
||||
*/
|
||||
getUrlParameter: function(sParam) {
|
||||
var sPageURL = decodeURIComponent(window.location.search.substring(1)),
|
||||
sURLVariables = sPageURL.split('&'),
|
||||
sParameterName,
|
||||
i;
|
||||
|
||||
for (i = 0; i < sURLVariables.length; i++)
|
||||
{
|
||||
sParameterName = sURLVariables[i].split('=');
|
||||
|
||||
if (sParameterName[0] === sParam)
|
||||
{
|
||||
return sParameterName[1];
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
/**
|
||||
* Generate the router URI using the connection parameters
|
||||
*/
|
||||
_generateRouterURI: function(remoteController) {
|
||||
var uri = null;
|
||||
|
||||
// Checks if global JS object FHC_JS_DATA_STORAGE_OBJECT exists
|
||||
if (typeof FHC_JS_DATA_STORAGE_OBJECT !== "undefined")
|
||||
{
|
||||
uri = FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + "/" + remoteController;
|
||||
}
|
||||
|
||||
return uri;
|
||||
},
|
||||
|
||||
/**
|
||||
* Method to print debug info after a controller has been called
|
||||
*/
|
||||
_printDebug: function(parameters, response, errorThrown) {
|
||||
|
||||
if (DEBUG === true) // If global const DEBUG is true, but really true!
|
||||
{
|
||||
// Print info about called controller
|
||||
console.log("Called controller: " + parameters.remoteController);
|
||||
console.log("Call parameters:"); // parameters given to this call
|
||||
console.log(parameters);
|
||||
|
||||
if (response != null) // if there is a response...
|
||||
{
|
||||
console.log("Controller Response:");
|
||||
console.log(response); // ...print it
|
||||
}
|
||||
if (errorThrown != null) // if there is a jQuery error...
|
||||
{
|
||||
console.log("jQuery error:");
|
||||
console.log(errorThrown); // ...print it
|
||||
}
|
||||
console.log("--------------------------------------------------------------------------------------------");
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Method to call if the ajax call has succeeded
|
||||
*/
|
||||
_onSuccess: function(response, textStatus, jqXHR) {
|
||||
|
||||
FHC_AjaxClient._printDebug(this._data, response); // debug time!
|
||||
|
||||
// Call the success callback saved in _successCallback property
|
||||
// NOTE: this is not referred to FHC_AjaxClient but to the ajax object
|
||||
this._successCallback(response);
|
||||
},
|
||||
|
||||
/**
|
||||
* Method to call if the ajax call has raised an error
|
||||
*/
|
||||
_onError: function(jqXHR, textStatus, errorThrown) {
|
||||
|
||||
FHC_AjaxClient._printDebug(this._data, null, errorThrown); // debug time!
|
||||
|
||||
// Call the error callback saved in _errorCallback property
|
||||
// NOTE: this is not referred to FHC_AjaxClient but to the ajax object
|
||||
this._errorCallback(jqXHR, textStatus, errorThrown);
|
||||
},
|
||||
|
||||
/**
|
||||
* Instantiate a new object and copy in it the properties from the parameter
|
||||
*/
|
||||
_cpObjProps: function(obj) {
|
||||
var returnObj = {};
|
||||
|
||||
for (var prop in obj)
|
||||
{
|
||||
returnObj[prop] = obj[prop];
|
||||
}
|
||||
|
||||
return returnObj;
|
||||
},
|
||||
|
||||
/**
|
||||
* Method to show the veil
|
||||
*/
|
||||
_showVeil: function() {
|
||||
if (FHC_AjaxClient._veilCallersCounter == 0)
|
||||
{
|
||||
$("<div class=\"veil\"></div>").appendTo('body');
|
||||
}
|
||||
|
||||
FHC_AjaxClient._veilCallersCounter++;
|
||||
},
|
||||
|
||||
/**
|
||||
* Method to hide the veil
|
||||
*/
|
||||
_hideVeil: function() {
|
||||
window.setTimeout(function() {
|
||||
if (FHC_AjaxClient._veilCallersCounter >= 0)
|
||||
{
|
||||
if (FHC_AjaxClient._veilCallersCounter > 0)
|
||||
{
|
||||
FHC_AjaxClient._veilCallersCounter--;
|
||||
}
|
||||
|
||||
if (FHC_AjaxClient._veilCallersCounter == 0)
|
||||
{
|
||||
$(".veil").remove();
|
||||
}
|
||||
}
|
||||
},
|
||||
this._veilTimeout);
|
||||
},
|
||||
|
||||
/**
|
||||
* Checks call parameters, if they are present and are valid
|
||||
* It generates and returns all the parameters needed to perform an ajax remote call
|
||||
* NOTE: console.error is used here because those are not messages for the final user,
|
||||
* but for the web interface developer
|
||||
*/
|
||||
_checkAndGenerateAjaxParams: function(remoteController, controllerParameters, type, ajaxCallParameters) {
|
||||
|
||||
var valid = true; // by default they are ok (we want to trust you, please do not betray it)
|
||||
|
||||
// Returned parameters
|
||||
var ajaxParameters = {
|
||||
cache: false, // data are never cached by the browser
|
||||
dataType: "json", // always json!
|
||||
type: type // set HTTP method, GET or POST
|
||||
};
|
||||
|
||||
// remoteController must be a NON-empty string
|
||||
if (typeof remoteController == "string" && remoteController.trim() != "")
|
||||
{
|
||||
// Is it possible to generate the URL
|
||||
if ((url = FHC_AjaxClient._generateRouterURI(remoteController)) != null)
|
||||
{
|
||||
ajaxParameters.url = url;
|
||||
}
|
||||
else // but it could fail
|
||||
{
|
||||
console.error("FHC_JS_DATA_STORAGE_OBJECT is not present");
|
||||
valid = false;
|
||||
}
|
||||
}
|
||||
else // otherwise is NOT possible to generate the URL
|
||||
{
|
||||
console.error("Invalid remoteController parameter");
|
||||
valid = false;
|
||||
}
|
||||
|
||||
// controllerParameters must be an object
|
||||
if (typeof controllerParameters == "object")
|
||||
{
|
||||
// Copy the properties of controllerParameters into a new object
|
||||
var data = FHC_AjaxClient._cpObjProps(controllerParameters);
|
||||
|
||||
// fhc_controller_id is given if present
|
||||
data[FHC_CONTROLLER_ID] = FHC_AjaxClient.getUrlParameter(FHC_CONTROLLER_ID);
|
||||
|
||||
// Stores them into ajaxParameters
|
||||
// NOTE: property data is not possible to get later,
|
||||
// so the variable data is saved also in _data and it will be used later
|
||||
ajaxParameters.data = data;
|
||||
ajaxParameters._data = data;
|
||||
}
|
||||
else
|
||||
{
|
||||
console.error("Invalid controller parameters, must be an object");
|
||||
valid = false;
|
||||
}
|
||||
|
||||
|
||||
// Checks if ajaxCallParameters is an object
|
||||
if (typeof ajaxCallParameters == "object")
|
||||
{
|
||||
// If present, errorCallback must be a function
|
||||
if (ajaxCallParameters.hasOwnProperty("errorCallback"))
|
||||
{
|
||||
if (typeof ajaxCallParameters.errorCallback == "function")
|
||||
{
|
||||
ajaxParameters._errorCallback = ajaxCallParameters.errorCallback; // save as property the callback error
|
||||
ajaxParameters.error = FHC_AjaxClient._onError; // function to call if an error occurred
|
||||
}
|
||||
else
|
||||
{
|
||||
console.error("Invalid errorCallback, it must be a function");
|
||||
valid = false;
|
||||
}
|
||||
}
|
||||
|
||||
// If present, successCallback must be a function
|
||||
if (ajaxCallParameters.hasOwnProperty("successCallback"))
|
||||
{
|
||||
if (typeof ajaxCallParameters.successCallback == "function")
|
||||
{
|
||||
ajaxParameters._successCallback = ajaxCallParameters.successCallback; // save as property the callback success
|
||||
ajaxParameters.success = FHC_AjaxClient._onSuccess; // function to call if succeeded
|
||||
}
|
||||
else
|
||||
{
|
||||
console.error("Invalid successCallback, it must be a function");
|
||||
valid = false;
|
||||
}
|
||||
}
|
||||
|
||||
// If present, veilTimeout must be a number and cannot be less then 0 or greater then 60000
|
||||
if (ajaxCallParameters.hasOwnProperty("veilTimeout") && typeof ajaxCallParameters.veilTimeout == "number")
|
||||
{
|
||||
if (ajaxCallParameters.veilTimeout > 0 && ajaxCallParameters.veilTimeout < 60000)
|
||||
{
|
||||
ajaxParameters._veilTimeout = ajaxCallParameters.veilTimeout;
|
||||
ajaxParameters.beforeSend = FHC_AjaxClient._showVeil;
|
||||
ajaxParameters.complete = FHC_AjaxClient._hideVeil;
|
||||
}
|
||||
else if(ajaxCallParameters.veilTimeout == 0)
|
||||
{
|
||||
// veil is disabled
|
||||
}
|
||||
else
|
||||
{
|
||||
console.error("Invalid veilTimeout parameter, must be a number >= 0 and <= 60000");
|
||||
valid = false;
|
||||
}
|
||||
}
|
||||
else // is not present or the value is invalid
|
||||
{
|
||||
ajaxParameters._veilTimeout = VEIL_TIMEOUT;
|
||||
ajaxParameters.beforeSend = FHC_AjaxClient._showVeil;
|
||||
ajaxParameters.complete = FHC_AjaxClient._hideVeil;
|
||||
}
|
||||
}
|
||||
|
||||
if (valid === false)
|
||||
{
|
||||
ajaxParameters = null;
|
||||
}
|
||||
|
||||
return ajaxParameters;
|
||||
},
|
||||
|
||||
/**
|
||||
* Performs a call to the server were the CI PHP layer is running
|
||||
* - remoteController: alias of the core controller to call
|
||||
* - controllerParameters: parameters to give to the called controller
|
||||
* - type: POST or GET HTTP method
|
||||
* - ajaxCallParameters is an object and could contains:
|
||||
* - errorCallback: function to call after an error has been raised
|
||||
* - successCallback: function to call after succeeded
|
||||
* - veilTimeout: veil timeout
|
||||
*/
|
||||
_ajaxCall: function(remoteController, controllerParameters, type, ajaxCallParameters) {
|
||||
// Retrives the parameters for the ajax call
|
||||
var ajaxParameters = FHC_AjaxClient._checkAndGenerateAjaxParams(remoteController, controllerParameters, type, ajaxCallParameters);
|
||||
|
||||
// Checks the given parameters if they are present and are valid
|
||||
if (ajaxParameters != null)
|
||||
{
|
||||
$.ajax(ajaxParameters); // ajax call
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,894 @@
|
||||
/**
|
||||
* FH-Complete
|
||||
*
|
||||
* @package
|
||||
* @author
|
||||
* @copyright Copyright (c) 2016 fhcomplete.org
|
||||
* @license GPLv3
|
||||
* @link https://fhcomplete.org
|
||||
* @since Version 1.0.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* Global function used by NavigationWidget JS to bind events to side menu elements
|
||||
*/
|
||||
function sideMenuHook()
|
||||
{
|
||||
$(".remove-custom-filter").click(function() {
|
||||
|
||||
// Ajax call to remove a custom filter
|
||||
FHC_AjaxClient.ajaxCallPost(
|
||||
"system/Filters/removeCustomFilter",
|
||||
{
|
||||
filter_id: $(this).attr("value"), // filter_id of the filter to be removed
|
||||
filter_page: FHC_FilterWidget.getFilterPage()
|
||||
},
|
||||
{
|
||||
successCallback: function(data, textStatus, jqXHR) {
|
||||
|
||||
if (FHC_AjaxClient.isError(data))
|
||||
{
|
||||
console.log(FHC_AjaxClient.getError(data));
|
||||
}
|
||||
else
|
||||
{
|
||||
// If a success and refreshSideMenu is a valid function then call it to refresh the side menu
|
||||
if (typeof refreshSideMenu == "function")
|
||||
{
|
||||
refreshSideMenu();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* FHC_FilterWidget this object is used to render the GUI of a filter widget and to operate with it
|
||||
*/
|
||||
var FHC_FilterWidget = {
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* To display the FilterWidget using the loaded data prenset in the session
|
||||
*/
|
||||
display: function() {
|
||||
|
||||
FHC_FilterWidget._getFilter(FHC_FilterWidget._renderFilterWidget);
|
||||
},
|
||||
|
||||
/**
|
||||
* Alias call to method display only to inprove the readability of the code
|
||||
*/
|
||||
refresh: function() {
|
||||
|
||||
FHC_FilterWidget.display();
|
||||
},
|
||||
|
||||
/**
|
||||
* To retrive the page where the FilterWidget is used, using the FHC_JS_DATA_STORAGE_OBJECT
|
||||
*/
|
||||
getFilterPage: function() {
|
||||
|
||||
return FHC_JS_DATA_STORAGE_OBJECT.called_path + "/" + FHC_JS_DATA_STORAGE_OBJECT.called_method;
|
||||
},
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
/**
|
||||
* Utility method that checks if data contains an error and print that to the console
|
||||
* otherwise the FilterWidget GUI is refreshed
|
||||
*/
|
||||
_failOrRefresh: function(data, textStatus, jqXHR) {
|
||||
|
||||
if (FHC_AjaxClient.isError(data))
|
||||
{
|
||||
console.log(FHC_AjaxClient.getError(data));
|
||||
}
|
||||
else
|
||||
{
|
||||
FHC_FilterWidget.refresh();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Utility method that checks if data contains an error and print that to the console
|
||||
* otherwise the page is reloaded
|
||||
*/
|
||||
_failOrReload: function(data, textStatus, jqXHR) {
|
||||
|
||||
if (FHC_AjaxClient.isError(data))
|
||||
{
|
||||
console.log(FHC_AjaxClient.getError(data));
|
||||
}
|
||||
else
|
||||
{
|
||||
location.reload();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* To reset the Filter Options GUI
|
||||
*/
|
||||
_resetGUI: function() {
|
||||
|
||||
$("#dragAndDropFieldsArea").html("");
|
||||
$("#addField").html("<option value=''>" + FHC_PhrasesLib.t("ui", "bitteEintragWaehlen") + "</option>");
|
||||
$("#appliedFilters").html("");
|
||||
$("#addFilter").html("<option value=''>" + FHC_PhrasesLib.t("ui", "bitteEintragWaehlen") + "</option>");
|
||||
$("#filterTableDataset > thead > tr").html("");
|
||||
$("#filterTableDataset > tbody").html("");
|
||||
},
|
||||
|
||||
/**
|
||||
* To get via Ajax all the data related to the FilterWidget present in the given page
|
||||
* If the parameter renderFunction is a valid function, is called on success
|
||||
*/
|
||||
_getFilter: function(renderFunction) {
|
||||
|
||||
FHC_AjaxClient.ajaxCallGet(
|
||||
"system/Filters/getFilter",
|
||||
{
|
||||
filter_page: FHC_FilterWidget.getFilterPage()
|
||||
},
|
||||
{
|
||||
successCallback: function(data, textStatus, jqXHR) {
|
||||
if (FHC_AjaxClient.hasData(data))
|
||||
{
|
||||
if (typeof renderFunction == "function")
|
||||
{
|
||||
renderFunction(FHC_AjaxClient.getData(data));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
console.log(FHC_AjaxClient.getError(data));
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
/**
|
||||
* This method calls all the other methods needed to rendere the GUI for a FilterWidget
|
||||
* The parameter data contains all the data about the FilterWidget and it is given as parameter
|
||||
* to all the methods that here are called
|
||||
* NOTE: think very carefully before changing the order of the calls
|
||||
*/
|
||||
_renderFilterWidget: function(data) {
|
||||
|
||||
FHC_FilterWidget._initSessionStorage(); // initialize the session storage
|
||||
FHC_FilterWidget._turnOffEvents(); // turns all the events off
|
||||
FHC_FilterWidget._resetGUI(); // Reset the entire GUI
|
||||
|
||||
// Render the GUI for this FilterWidget
|
||||
FHC_FilterWidget._setFilterName(data); // set the name in the GUI
|
||||
FHC_FilterWidget._renderDragAndDropFields(data); // render the fields drag and drop GUI
|
||||
FHC_FilterWidget._renderDropDownFields(data); // render the fields drop-down
|
||||
FHC_FilterWidget._renderAppliedFilters(data); // render the GUI for the applied filters
|
||||
FHC_FilterWidget._renderDropDownFilters(data); // render the filters drop-down
|
||||
FHC_FilterWidget._renderTableDataset(data); // render the table GUI
|
||||
|
||||
FHC_FilterWidget._turnOnEvents(); // turns all the events off
|
||||
},
|
||||
|
||||
/**
|
||||
* Initialize the session storage
|
||||
*/
|
||||
_initSessionStorage: function() {
|
||||
|
||||
// If the browser supports storage
|
||||
if (typeof(Storage) !== "undefined")
|
||||
{
|
||||
// Checks if the "filter-options-status" is present in the session storage and if is equal to "open"
|
||||
if (sessionStorage.getItem("filter-options-status") && sessionStorage.getItem("filter-options-status") == "open")
|
||||
{
|
||||
$(".collapse").collapse("show"); // then open the filter options panel
|
||||
}
|
||||
else
|
||||
{
|
||||
sessionStorage.setItem("filter-options-status", "closed"); // otherwise set "filter-options-status" to "close"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Turns all the events off
|
||||
* NOTE: must be aligned to _turnOnEvents
|
||||
*/
|
||||
_turnOffEvents: function() {
|
||||
|
||||
$("[data-toggle='collapse']").off("click");
|
||||
$(".drag-and-drop-fields-span").off("draggable");
|
||||
$(".drag-and-drop-fields-span").off("droppable");
|
||||
$(".remove-selected-field").off("click");
|
||||
$("#addField").off("change");
|
||||
$(".applied-filter-operation").off("change");
|
||||
$(".remove-applied-filter").off("click");
|
||||
$("#addFilter").off("change");
|
||||
$("#applyFilter").off("click");
|
||||
$("#saveCustomFilterButton").off("click");
|
||||
FHC_FilterWidget._disableTableSorter();
|
||||
},
|
||||
|
||||
/**
|
||||
* Turns all the events on
|
||||
* NOTE: must be aligned to _turnOffEvents
|
||||
*/
|
||||
_turnOnEvents: function() {
|
||||
|
||||
$("[data-toggle='collapse']").click(FHC_FilterWidget._dataToggleCollapseEvent); // Click event to collapse or to open the filter options panel
|
||||
$(".drag-and-drop-fields-span").draggable(FHC_FilterWidget._draggableConf); // draggable event on selected fields
|
||||
$(".drag-and-drop-fields-span").droppable(FHC_FilterWidget._droppableConf); // droppable event on selected fields
|
||||
$(".remove-selected-field").click(FHC_FilterWidget._revomeSelectedFieldsEvent); // Click event on the "X" link
|
||||
$("#addField").change(FHC_FilterWidget._addFieldEvent); // Change event on the fields drop-down to add new fields
|
||||
$(".applied-filter-operation").change(FHC_FilterWidget._appliedFiltersOperationsEvent); // Change event on the operation drop-down
|
||||
$(".remove-applied-filter").click(FHC_FilterWidget._removeAppliedFiltersEvent); // Click event to the "X" button to remove an applied filter
|
||||
$("#addFilter").change(FHC_FilterWidget._addFilterEvent); // Click event on the applied filters drop-down to add a new filter to the dataset
|
||||
$("#applyFilter").click(FHC_FilterWidget._applyFilterEvent); // Click event on the applied filters drop-down to apply filters to the dataset
|
||||
$("#saveCustomFilterButton").click(FHC_FilterWidget._saveCustomFilterButtonEvent); // Click evento to for the save custom filter button
|
||||
FHC_FilterWidget._enableTableSorter(); // enable the tablesorter
|
||||
},
|
||||
|
||||
/**
|
||||
* Configuration object used by draggable event on selected fields
|
||||
*/
|
||||
_draggableConf: {
|
||||
containment: "parent",
|
||||
cursor: "move",
|
||||
opacity: 0.4,
|
||||
revert: "invalid",
|
||||
revertDuration: 200,
|
||||
drag: function(event, ui) {
|
||||
|
||||
var padding = 20;
|
||||
var draggedElement = $(this);
|
||||
|
||||
$(".drag-and-drop-fields-span").each(function(i, e) {
|
||||
|
||||
if ($(this).attr("id") != draggedElement.attr("id"))
|
||||
{
|
||||
$(this).removeClass("selection-after");
|
||||
$(this).removeClass("selection-before");
|
||||
|
||||
var elementCenter = $(this).offset().left + ((padding + $(this).width()) / 2);
|
||||
|
||||
if (event.pageX > ($(this).offset().left - (padding / 2))
|
||||
&& event.pageX < ($(this).offset().left + $(this).width() + (padding / 2)))
|
||||
{
|
||||
if (event.pageX > elementCenter)
|
||||
{
|
||||
$(this).addClass("selection-after");
|
||||
$(this).removeClass("selection-before");
|
||||
}
|
||||
else if (event.pageX < elementCenter)
|
||||
{
|
||||
$(this).addClass("selection-before");
|
||||
$(this).removeClass("selection-after");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Configuration object used by droppable event on selected fields
|
||||
*/
|
||||
_droppableConf: {
|
||||
accept: ".drag-and-drop-fields-span",
|
||||
drop: function(event, ui) {
|
||||
|
||||
var padding = 20;
|
||||
var elementCenter = $(this).offset().left + ((padding + $(this).width()) / 2);
|
||||
var draggedElement = ui.helper;
|
||||
|
||||
if (event.pageX > elementCenter)
|
||||
{
|
||||
draggedElement.insertAfter($(this));
|
||||
}
|
||||
else if (event.pageX < elementCenter)
|
||||
{
|
||||
draggedElement.insertBefore($(this));
|
||||
}
|
||||
|
||||
$(this).removeClass("selection-before");
|
||||
$(this).removeClass("selection-after");
|
||||
|
||||
draggedElement.css({left: "0px", top: "10px"});
|
||||
|
||||
var arrayDndId = [];
|
||||
|
||||
$(".drag-and-drop-fields-span").each(function(i, e) {
|
||||
|
||||
arrayDndId[i] = $(this).attr("id").replace("dnd", "");
|
||||
|
||||
});
|
||||
|
||||
FHC_AjaxClient.ajaxCallPost(
|
||||
"system/Filters/sortSelectedFields",
|
||||
{
|
||||
selectedFields: arrayDndId,
|
||||
filter_page: FHC_FilterWidget.getFilterPage()
|
||||
},
|
||||
{
|
||||
successCallback: function(data, textStatus, jqXHR) {
|
||||
FHC_FilterWidget._cleanTablesorterLocalStorage();
|
||||
FHC_FilterWidget._failOrRefresh(data, textStatus, jqXHR);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Event function used to remove selected fields
|
||||
*/
|
||||
_revomeSelectedFieldsEvent: function(event) {
|
||||
|
||||
FHC_AjaxClient.ajaxCallPost(
|
||||
"system/Filters/removeSelectedField",
|
||||
{
|
||||
selectedField: $(this).attr("fieldToRemove"),
|
||||
filter_page: FHC_FilterWidget.getFilterPage()
|
||||
},
|
||||
{
|
||||
successCallback: function(data, textStatus, jqXHR) {
|
||||
FHC_FilterWidget._failOrRefresh(data, textStatus, jqXHR);
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
/**
|
||||
* Event function used by the applied filter operation drop-down to hide others element when thery are not needed
|
||||
*/
|
||||
_appliedFiltersOperationsEvent: function(event) {
|
||||
|
||||
if ($(this).val() == "set" || $(this).val() == "nset")
|
||||
{
|
||||
$(this).parent().parent().find(".applied-filter-condition").addClass("hidden-control");
|
||||
$(this).parent().parent().find(".applied-filter-option").addClass("hidden-control");
|
||||
$(this).parent().parent().find(".applied-filter-condition").prop("disabled", true);
|
||||
$(this).parent().parent().find(".applied-filter-option").prop("disabled", true);
|
||||
}
|
||||
else
|
||||
{
|
||||
$(this).parent().parent().find(".applied-filter-condition").removeClass("hidden-control");
|
||||
$(this).parent().parent().find(".applied-filter-option").removeClass("hidden-control");
|
||||
$(this).parent().parent().find(".applied-filter-condition").prop("disabled", false);
|
||||
$(this).parent().parent().find(".applied-filter-option").prop("disabled", false);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Event function used by the add field drop-down
|
||||
*/
|
||||
_addFieldEvent: function(event) {
|
||||
|
||||
FHC_AjaxClient.ajaxCallPost(
|
||||
"system/Filters/addSelectedField",
|
||||
{
|
||||
selectedField: $(this).val(),
|
||||
filter_page: FHC_FilterWidget.getFilterPage()
|
||||
},
|
||||
{
|
||||
successCallback: function(data, textStatus, jqXHR) {
|
||||
FHC_FilterWidget._cleanTablesorterLocalStorage();
|
||||
FHC_FilterWidget._failOrRefresh(data, textStatus, jqXHR);
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
/**
|
||||
* Event function used by the apply filter button
|
||||
*/
|
||||
_applyFilterEvent: function() {
|
||||
|
||||
var appliedFilters = [];
|
||||
var appliedFiltersOperations = [];
|
||||
var appliedFiltersConditions = [];
|
||||
var appliedFiltersOptions = [];
|
||||
|
||||
$("#appliedFilters > div").each(function(i, e) {
|
||||
appliedFilters.push($(this).find(".hidden-field-name").val());
|
||||
appliedFiltersOperations.push($(this).find(".applied-filter-operation").val());
|
||||
appliedFiltersConditions.push($(this).find(".applied-filter-condition:enabled").val());
|
||||
appliedFiltersOptions.push($(this).find(".applied-filter-option:enabled").val());
|
||||
});
|
||||
|
||||
FHC_AjaxClient.ajaxCallPost(
|
||||
"system/Filters/applyFilters",
|
||||
{
|
||||
appliedFilters: appliedFilters,
|
||||
appliedFiltersOperations: appliedFiltersOperations,
|
||||
appliedFiltersConditions: appliedFiltersConditions,
|
||||
appliedFiltersOptions: appliedFiltersOptions,
|
||||
filter_page: FHC_FilterWidget.getFilterPage()
|
||||
},
|
||||
{
|
||||
successCallback: function(data, textStatus, jqXHR) {
|
||||
FHC_FilterWidget._failOrReload(data, textStatus, jqXHR);
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
/**
|
||||
* Event function used to remove an applied filter to the dataset
|
||||
*/
|
||||
_removeAppliedFiltersEvent: function(event) {
|
||||
|
||||
FHC_AjaxClient.ajaxCallPost(
|
||||
"system/Filters/removeAppliedFilter",
|
||||
{
|
||||
appliedFilter: $(this).attr("filterToRemove"),
|
||||
filter_page: FHC_FilterWidget.getFilterPage()
|
||||
},
|
||||
{
|
||||
successCallback: function(data, textStatus, jqXHR) {
|
||||
FHC_FilterWidget._failOrReload(data, textStatus, jqXHR);
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
/**
|
||||
* Event function used to add a new filter to the dataset
|
||||
*/
|
||||
_addFilterEvent: function(event) {
|
||||
|
||||
FHC_AjaxClient.ajaxCallPost(
|
||||
"system/Filters/addFilter",
|
||||
{
|
||||
filter: $(this).val(),
|
||||
filter_page: FHC_FilterWidget.getFilterPage()
|
||||
},
|
||||
{
|
||||
successCallback: function(data, textStatus, jqXHR) {
|
||||
FHC_FilterWidget._failOrRefresh(data, textStatus, jqXHR);
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
/**
|
||||
* Event function used to collapse the filter options panel and to store the info into the session storage
|
||||
*/
|
||||
_dataToggleCollapseEvent: function() {
|
||||
|
||||
if (typeof(Storage) !== "undefined")
|
||||
{
|
||||
if (sessionStorage.getItem("filter-options-status"))
|
||||
{
|
||||
if (sessionStorage.getItem("filter-options-status") == "closed")
|
||||
{
|
||||
sessionStorage.setItem("filter-options-status", "open");
|
||||
}
|
||||
else
|
||||
{
|
||||
sessionStorage.setItem("filter-options-status", "closed");
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Event function used to save a custom filter
|
||||
*/
|
||||
_saveCustomFilterButtonEvent: function() {
|
||||
|
||||
if ($("#customFilterDescription").val() != "")
|
||||
{
|
||||
FHC_AjaxClient.ajaxCallPost(
|
||||
"system/Filters/saveCustomFilter",
|
||||
{
|
||||
customFilterDescription: $("#customFilterDescription").val(),
|
||||
filter_page: FHC_FilterWidget.getFilterPage()
|
||||
},
|
||||
{
|
||||
successCallback: refreshSideMenu // NOTE: to be checked
|
||||
}
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
alert("Please fill the description of this filter");
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Retrive the filter name from data and display it in the GUI
|
||||
*/
|
||||
_setFilterName: function(data) {
|
||||
|
||||
if (data.hasOwnProperty("filterName"))
|
||||
{
|
||||
$(".filter-name-title").html(data.filterName);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Renders the drag and drop GUI for the fields of the FilterWidget
|
||||
* Retrieves the list of used fields, the list of all the fields and
|
||||
* their possibly present aliases from the parameter data
|
||||
*/
|
||||
_renderDragAndDropFields: function(data) {
|
||||
|
||||
var arrayFieldsToDisplay = FHC_FilterWidget._getFieldsToDisplay(data);
|
||||
|
||||
for (var i = 0; i < arrayFieldsToDisplay.length; i++)
|
||||
{
|
||||
var fieldToDisplay = arrayFieldsToDisplay[i];
|
||||
var fieldName = data.selectedFields[i];
|
||||
|
||||
var strHtml = "<span id='dnd" + fieldName + "' class='drag-and-drop-fields-span'>";
|
||||
strHtml += " <span>" + fieldToDisplay + "</span>";
|
||||
strHtml += " <span>";
|
||||
strHtml += " <a class='remove-selected-field' fieldToRemove='" + fieldName + "'> X </a>";
|
||||
strHtml += " </span>";
|
||||
strHtml += "</span>";
|
||||
|
||||
$("#dragAndDropFieldsArea").append(strHtml);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Renders the drop-down element that contains all the usable fields in the FilterWidget
|
||||
* The list of all usable fields and their possibly aliases are retrieved from the parameter data
|
||||
*/
|
||||
_renderDropDownFields: function(data) {
|
||||
|
||||
if (data.hasOwnProperty("fields") && $.isArray(data.fields))
|
||||
{
|
||||
FHC_FilterWidget._renderDropDown(data, data.selectedFields, 'addField');
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Renders a dropdown attached to the HTML element ddElementId, using the elements from data.fields
|
||||
* and excluding the elements that are prenset in the elements parameter
|
||||
*/
|
||||
_renderDropDown: function(data, elements, ddElementId) {
|
||||
|
||||
for (var i = 0; i < data.fields.length; i++)
|
||||
{
|
||||
var toBeDisplayed = true;
|
||||
|
||||
for (var j = 0; j < elements.length; j++)
|
||||
{
|
||||
var elementName = elements[j].hasOwnProperty("name") ? elements[j].name : elements[j];
|
||||
|
||||
if (data.fields[i] == elementName)
|
||||
{
|
||||
toBeDisplayed = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (toBeDisplayed == true)
|
||||
{
|
||||
var fieldName = data.fields[i];
|
||||
var fieldToDisplay = data.fields[i];
|
||||
|
||||
if (data.hasOwnProperty("columnsAliases") && $.isArray(data.columnsAliases))
|
||||
{
|
||||
fieldToDisplay = data.columnsAliases[i];
|
||||
}
|
||||
|
||||
if ($("#" + ddElementId).length) // checks if the element exists
|
||||
{
|
||||
$("#" + ddElementId).append("<option value='" + fieldName + "'>" + fieldToDisplay + "</option>");
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Render the GUI to operate with the filters applied to the dataset
|
||||
* The list of all applied filters is retrieved from the parameter data
|
||||
*/
|
||||
_renderAppliedFilters: function(data) {
|
||||
|
||||
if (data.hasOwnProperty("datasetMetadata") && $.isArray(data.datasetMetadata)
|
||||
&& data.hasOwnProperty("filters") && $.isArray(data.filters))
|
||||
{
|
||||
for (var i = 0; i < data.filters.length; i++)
|
||||
{
|
||||
for (var j = 0; j < data.datasetMetadata.length; j++)
|
||||
{
|
||||
if (data.filters[i].name == data.datasetMetadata[j].name)
|
||||
{
|
||||
var appliedFilters = "<div>";
|
||||
|
||||
appliedFilters += "<span class='filter-span-label'>";
|
||||
|
||||
if (data.hasOwnProperty("columnsAliases") && $.isArray(data.columnsAliases))
|
||||
{
|
||||
fieldToDisplay = data.columnsAliases[j];
|
||||
}
|
||||
else
|
||||
{
|
||||
fieldToDisplay = data.datasetMetadata[j].name;
|
||||
}
|
||||
|
||||
appliedFilters += fieldToDisplay;
|
||||
appliedFilters += "</span>";
|
||||
|
||||
appliedFilters += FHC_FilterWidget._renderSingleAppliedFilter(data.filters[i], data.datasetMetadata[j]);
|
||||
|
||||
appliedFilters += "</div>";
|
||||
|
||||
$("#appliedFilters").append(appliedFilters);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Renders the drop-down element that contains all the possibly fields that can be used
|
||||
* to apply a filter to the dataset
|
||||
* The list of all usable fields and their possibly aliases are retrieved from the parameter data
|
||||
*/
|
||||
_renderDropDownFilters: function(data) {
|
||||
|
||||
FHC_FilterWidget._renderDropDown(data, data.filters, 'addFilter');
|
||||
},
|
||||
|
||||
/**
|
||||
* Renders a single applied filter to the dataset using the applied filter configuration and its related metadata
|
||||
*/
|
||||
_renderSingleAppliedFilter: function(appliedFilter, metaData) {
|
||||
|
||||
var html = "";
|
||||
|
||||
if (metaData.type.toLowerCase().indexOf("int") >= 0)
|
||||
{
|
||||
if (appliedFilter.condition == null) appliedFilter.condition = 0;
|
||||
|
||||
html = "<span>";
|
||||
html += " <select class='form-control applied-filter-operation'>";
|
||||
html += " <option value='equal' " + (appliedFilter.operation == "equal" ? "selected" : "") + ">equal</option>";
|
||||
html += " <option value='nequal' " + (appliedFilter.operation == "nqual" ? "selected" : "") + ">not equal</option>";
|
||||
html += " <option value='gt' " + (appliedFilter.operation == "gt" ? "selected" : "") + ">greater than</option>";
|
||||
html += " <option value='lt' " + (appliedFilter.operation == "lt" ? "selected" : "") + ">less than</option>";
|
||||
html += " </select>";
|
||||
html += "</span>";
|
||||
html += "<span>";
|
||||
html += " <input type='numbe' value='" + appliedFilter.condition + "' class='form-control applied-filter-condition'>";
|
||||
html += "</span>";
|
||||
}
|
||||
if (metaData.type.toLowerCase().indexOf("varchar") >= 0 || metaData.type.toLowerCase() == "text")
|
||||
{
|
||||
if (appliedFilter.condition == null) appliedFilter.condition = "";
|
||||
|
||||
html = "<span>";
|
||||
html += " <select class='form-control applied-filter-operation'>";
|
||||
html += " <option value='contains' " + (appliedFilter.operation == "contains" ? "selected" : "") + ">contains</option>";
|
||||
html += " <option value='ncontains' " + (appliedFilter.operation == "ncontains" ? "selected" : "") + ">does not contain</option>";
|
||||
html += " </select>";
|
||||
html += "</span>";
|
||||
html += "<span>";
|
||||
html += " <input type='text' value='" + appliedFilter.condition + "' class='form-control applied-filter-condition'>";
|
||||
html += "</span>";
|
||||
}
|
||||
if (metaData.type.toLowerCase().indexOf("bool") >= 0)
|
||||
{
|
||||
html = "<span>";
|
||||
html += " <select class='form-control applied-filter-operation'>";
|
||||
html += " <option value='true' " + (appliedFilter.operation == "true" ? "selected" : "") + ">is true</option>";
|
||||
html += " <option value='false' " + (appliedFilter.operation == "false" ? "selected" : "") + ">is false</option>";
|
||||
html += " </select>";
|
||||
html += "</span>";
|
||||
html += "<span>";
|
||||
html += " <input type='hidden' value='" + appliedFilter.condition + "' class='form-control applied-filter-condition'>";
|
||||
html += "</span>";
|
||||
}
|
||||
if (metaData.type.toLowerCase().indexOf("timestamp") >= 0 || metaData.type.toLowerCase().indexOf("date") >= 0)
|
||||
{
|
||||
var classOperation = "form-control applied-filter-condition";
|
||||
var classOption = "form-control applied-filter-option";
|
||||
var disabled = "";
|
||||
|
||||
if (appliedFilter.condition == null) appliedFilter.condition = 0;
|
||||
|
||||
if (appliedFilter.operation == "set" || appliedFilter.operation == "nset")
|
||||
{
|
||||
classOperation += " hidden-control";
|
||||
classOption += " hidden-control";
|
||||
disabled = "disabled";
|
||||
}
|
||||
|
||||
html = "<span>";
|
||||
html += " <select class='form-control applied-filter-operation'>";
|
||||
html += " <option value='lt' " + (appliedFilter.operation == "lt" ? "selected" : "") + ">less than</option>";
|
||||
html += " <option value='gt' " + (appliedFilter.operation == "gt" ? "selected" : "") + ">greater than</option>";
|
||||
html += " <option value='set' " + (appliedFilter.operation == "set" ? "selected" : "") + ">is set</option>";
|
||||
html += " <option value='nset' " + (appliedFilter.operation == "nset" ? "selected" : "") + ">is not set</option>";
|
||||
html += " </select>";
|
||||
html += "</span>";
|
||||
html += "<span>";
|
||||
html += " <input type='number' value='" + appliedFilter.condition + "' class='" + classOperation + "' " + disabled + ">";
|
||||
html += "</span>";
|
||||
html += "<span>";
|
||||
html += " <select class='" + classOption + "' " + disabled + ">";
|
||||
html += " <option value='days' " + (appliedFilter.option == "days" ? "selected" : "") + ">Days</option>";
|
||||
html += " <option value='months' " + (appliedFilter.option == "months" ? "selected" : "") + ">Months</option>";
|
||||
html += " </select>";
|
||||
html += "</span>";
|
||||
}
|
||||
|
||||
html += "<span>";
|
||||
html += " <input type='hidden' value='" + metaData.name + "' class='hidden-field-name'>";
|
||||
html += "</span>";
|
||||
|
||||
html += "<span>";
|
||||
html += " <input type='button' value='X' class='remove-applied-filter btn btn-default' filterToRemove='" + appliedFilter.name + "'>";
|
||||
html += "</span>";
|
||||
|
||||
return html;
|
||||
},
|
||||
|
||||
/**
|
||||
* Renders the table for the FilterWidget
|
||||
* The data to be displayed are retrived from the parameter data
|
||||
*/
|
||||
_renderTableDataset: function(data) {
|
||||
|
||||
if (data.hasOwnProperty("checkboxes") && data.checkboxes.trim() != "")
|
||||
{
|
||||
$("#filterTableDataset > thead > tr").append("<th data-filter='false' title='Select'>Select</th>");
|
||||
}
|
||||
|
||||
var arrayFieldsToDisplay = FHC_FilterWidget._getFieldsToDisplay(data);
|
||||
|
||||
for (var i = 0; i < arrayFieldsToDisplay.length; i++)
|
||||
{
|
||||
var columnName = arrayFieldsToDisplay[i];
|
||||
|
||||
$("#filterTableDataset > thead > tr").append("<th title='" + columnName + "'>" + columnName + "</th>");
|
||||
}
|
||||
|
||||
if (data.hasOwnProperty("additionalColumns") && $.isArray(data.additionalColumns))
|
||||
{
|
||||
for (var i = 0; i < data.additionalColumns.length; i++)
|
||||
{
|
||||
var columnName = data.additionalColumns[i];
|
||||
|
||||
$("#filterTableDataset > thead > tr").append("<th title='" + columnName + "'>" + columnName + "</th>");
|
||||
}
|
||||
}
|
||||
|
||||
if (arrayFieldsToDisplay.length > 0)
|
||||
{
|
||||
if (data.hasOwnProperty("dataset") && $.isArray(data.dataset))
|
||||
{
|
||||
for (var i = 0; i < data.dataset.length; i++)
|
||||
{
|
||||
var record = data.dataset[i];
|
||||
var strHtml = "<tr class='" + record.MARK_ROW_CLASS + "'>";
|
||||
|
||||
if (data.checkboxes != null && data.checkboxes != "")
|
||||
{
|
||||
strHtml += "<td>";
|
||||
strHtml += "<input type='checkbox' name='" + data.checkboxes + "[]' value='" + record[data.checkboxes] + "'>";
|
||||
strHtml += "</td>";
|
||||
}
|
||||
|
||||
$.each(arrayFieldsToDisplay, function(i, fieldToDisplay) {
|
||||
|
||||
if (record.hasOwnProperty(data.selectedFields[i]))
|
||||
{
|
||||
strHtml += "<td>" + record[data.selectedFields[i]] + "</td>";
|
||||
}
|
||||
});
|
||||
|
||||
if (data.additionalColumns != null && $.isArray(data.additionalColumns))
|
||||
{
|
||||
$.each(data.additionalColumns, function(i, additionalColumn) {
|
||||
|
||||
if (record.hasOwnProperty(additionalColumn))
|
||||
{
|
||||
strHtml += "<td>" + record[additionalColumn] + "</td>";
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
strHtml += "</tr>";
|
||||
|
||||
$("#filterTableDataset > tbody").append(strHtml);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Enable the tablesorter libs to render the dataset table with sorting features
|
||||
*/
|
||||
_enableTableSorter: function() {
|
||||
|
||||
// Checks if the table contains data (rows)
|
||||
if ($("#filterTableDataset").find("tbody:empty").length == 0
|
||||
&& $("#filterTableDataset").find("tr:empty").length == 0
|
||||
&& $("#filterTableDataset").hasClass("table-condensed"))
|
||||
{
|
||||
$("#filterTableDataset").tablesorter({
|
||||
widgets: ["zebra", "filter"],
|
||||
widgetOptions: {
|
||||
filter_saveFilters : true
|
||||
}
|
||||
});
|
||||
|
||||
// reset filter storage if there is a filter id in url TODO: find better solution
|
||||
var filter_id = FHC_AjaxClient.getUrlParameter("filter_id");
|
||||
if (typeof filter_id !== "undefined") FHC_FilterWidget._cleanTablesorterLocalStorage();
|
||||
|
||||
$.tablesorter.updateAll($("#filterTableDataset")[0].config, true, null);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Disable the tablesorter
|
||||
*/
|
||||
_disableTableSorter: function() {
|
||||
|
||||
$("#filterTableDataset").trigger("disable");
|
||||
},
|
||||
|
||||
/**
|
||||
* Retrives the fields to be displayed from the data parameter, if aliases are present then they are used
|
||||
*/
|
||||
_getFieldsToDisplay: function(data) {
|
||||
|
||||
var arrayFieldsToDisplay = [];
|
||||
|
||||
if (data.hasOwnProperty("selectedFields") && $.isArray(data.selectedFields))
|
||||
{
|
||||
if (data.hasOwnProperty("columnsAliases") && $.isArray(data.columnsAliases))
|
||||
{
|
||||
for (var i = 0; i < data.selectedFields.length; i++)
|
||||
{
|
||||
for (var j = 0; j < data.fields.length; j++)
|
||||
{
|
||||
if (data.selectedFields[i] == data.fields[j])
|
||||
{
|
||||
arrayFieldsToDisplay[i] = data.columnsAliases[j];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
arrayFieldsToDisplay = data.selectedFields;
|
||||
}
|
||||
}
|
||||
|
||||
return arrayFieldsToDisplay;
|
||||
},
|
||||
|
||||
/**
|
||||
* Tablesorter filter local storage clean
|
||||
*/
|
||||
_cleanTablesorterLocalStorage: function() {
|
||||
|
||||
$("#filterTableDataset").trigger("filterResetSaved");
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* When JQuery is up
|
||||
*/
|
||||
$(document).ready(function() {
|
||||
|
||||
FHC_FilterWidget.display();
|
||||
|
||||
});
|
||||
@@ -0,0 +1,198 @@
|
||||
/**
|
||||
* FH-Complete
|
||||
*
|
||||
* @package
|
||||
* @author
|
||||
* @copyright Copyright (c) 2016 fhcomplete.org
|
||||
* @license GPLv3
|
||||
* @link https://fhcomplete.org
|
||||
* @since Version 1.0.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* FHC_NavigationWidget
|
||||
*/
|
||||
var FHC_NavigationWidget = {
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* Renders the header menu (top horizontal menu)
|
||||
*/
|
||||
renderHeaderMenu: function() {
|
||||
//
|
||||
FHC_AjaxClient.ajaxCallGet(
|
||||
'system/Navigation/header',
|
||||
{
|
||||
navigation_widget_called: FHC_NavigationWidget._getNavigationWidgetCalled()
|
||||
},
|
||||
{
|
||||
successCallback: function(data, textStatus, jqXHR) {
|
||||
if (data != null)
|
||||
{
|
||||
jQuery.each(data, function(i, e) {
|
||||
$(".menu-header-items").append('<a class="navbar-brand" href="' + e + '">' + i + '</a>');
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
/**
|
||||
* Renders the side left menu
|
||||
*/
|
||||
renderSideMenu: function() {
|
||||
//
|
||||
FHC_AjaxClient.ajaxCallGet(
|
||||
'system/Navigation/menu',
|
||||
{
|
||||
navigation_widget_called: FHC_NavigationWidget._getNavigationWidgetCalled()
|
||||
},
|
||||
{
|
||||
successCallback: function(data, textStatus, jqXHR) {
|
||||
if (data != null)
|
||||
{
|
||||
var strMenu = '';
|
||||
|
||||
FHC_NavigationWidget._printCollapseIcon();
|
||||
|
||||
jQuery.each(data, function(i, e) {
|
||||
strMenu += FHC_NavigationWidget._printNavItem(e);
|
||||
});
|
||||
|
||||
$("#side-menu").html(strMenu);
|
||||
$("#side-menu").metisMenu();
|
||||
}
|
||||
|
||||
if (typeof sideMenuHook == 'function')
|
||||
{
|
||||
sideMenuHook();
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
_printCollapseIcon: function() {
|
||||
// Hiding/showing navigation menu - works only with sb admin 2 template!!
|
||||
if(!$("#collapseicon").length)
|
||||
$("#side-menu").parent().append('<div id="collapseicon" title="hide Menu" class="text-right" style="cursor: pointer; color: #337ab7"><i class="fa fa-angle-double-left fa-fw"></i></div>');
|
||||
|
||||
$("#collapseicon").click(function() {
|
||||
$("#page-wrapper").css('margin-left', '0px');
|
||||
$("#side-menu").hide();
|
||||
$("#collapseicon").hide();
|
||||
$("#collapseinicon").show();
|
||||
});
|
||||
|
||||
$("#collapseinicon").click(function() {
|
||||
$("#page-wrapper").css('margin-left', '250px');
|
||||
$("#side-menu").show();
|
||||
$("#collapseicon").show();
|
||||
$("#collapseinicon").hide();
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
_printNavItem: function(item, depth = 1) {
|
||||
strMenu = "";
|
||||
var expanded = typeof item['expand'] != 'undefined' && item['expand'] === true ? ' active' : '';
|
||||
|
||||
strMenu += '<li class="' + expanded + '">';
|
||||
|
||||
if (typeof item['subscriptLinkClass'] != 'undefined' && typeof item['subscriptDescription'] != 'undefined')
|
||||
{
|
||||
strMenu += '<span>';
|
||||
}
|
||||
|
||||
// Handle fhc_controller_id
|
||||
var fhc_controller_id = FHC_AjaxClient.getUrlParameter('fhc_controller_id');
|
||||
if (fhc_controller_id != null && fhc_controller_id != '' && item['link'] != '#')
|
||||
{
|
||||
if (item['link'].indexOf('?') != -1)
|
||||
{
|
||||
item['link'] += '&';
|
||||
}
|
||||
else
|
||||
{
|
||||
item['link'] += '?';
|
||||
}
|
||||
|
||||
item['link'] += 'fhc_controller_id=' + fhc_controller_id;
|
||||
}
|
||||
|
||||
strMenu += '<a href="' + item['link'] + '"' + expanded + '>';
|
||||
|
||||
if (item['icon'] != 'undefined')
|
||||
{
|
||||
strMenu += '<i class="fa fa-' + item['icon'] + ' fa-fw"></i> ';
|
||||
}
|
||||
|
||||
strMenu += item['description'];
|
||||
|
||||
if (typeof item['children'] != 'undefined' && Object.keys(item['children']).length > 0)
|
||||
{
|
||||
strMenu += '<span class="fa arrow"></span>';
|
||||
}
|
||||
|
||||
strMenu += '</a>';
|
||||
|
||||
if (typeof item['subscriptLinkClass'] != 'undefined' && typeof item['subscriptDescription'] != 'undefined')
|
||||
{
|
||||
strMenu += '<a class="' + item['subscriptLinkClass'] + ' menuSubscriptLink" value="' + item['subscriptLinkValue'] + '" href="#"> (' + item['subscriptDescription'] + ')</a>';
|
||||
strMenu += '</span>';
|
||||
}
|
||||
|
||||
if (typeof item['children'] != 'undefined' && Object.keys(item['children']).length > 0)
|
||||
{
|
||||
var level = '';
|
||||
if (depth === 1)
|
||||
{
|
||||
level = 'second';
|
||||
}
|
||||
else if (depth > 1)
|
||||
{
|
||||
level = 'third';
|
||||
}
|
||||
|
||||
strMenu += '<ul class="nav nav-' + level + '-level" ' + expanded + '>';
|
||||
|
||||
jQuery.each(item['children'], function(i, e) {
|
||||
strMenu += FHC_NavigationWidget._printNavItem(e, ++depth);
|
||||
});
|
||||
|
||||
strMenu += '</ul>';
|
||||
}
|
||||
|
||||
strMenu += '</li>';
|
||||
|
||||
return strMenu;
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns the URI of the caller
|
||||
*/
|
||||
_getNavigationWidgetCalled: function() {
|
||||
return FHC_JS_DATA_STORAGE_OBJECT.called_path + "/" + FHC_JS_DATA_STORAGE_OBJECT.called_method;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* When JQuery is up
|
||||
*/
|
||||
$(document).ready(function() {
|
||||
|
||||
FHC_NavigationWidget.renderHeaderMenu();
|
||||
|
||||
FHC_NavigationWidget.renderSideMenu();
|
||||
|
||||
});
|
||||
@@ -0,0 +1,73 @@
|
||||
/**
|
||||
* FH-Complete
|
||||
*
|
||||
* @package
|
||||
* @author
|
||||
* @copyright Copyright (c) 2016 fhcomplete.org
|
||||
* @license GPLv3
|
||||
* @link https://fhcomplete.org
|
||||
* @since Version 1.0.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* Definition and initialization of object FHC_PhrasesLib
|
||||
*/
|
||||
var FHC_PhrasesLib = {
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* Returns the phrase-text in the user's language
|
||||
* @param {String} category : phrase-category
|
||||
* @param {String} phrase : phrase-name
|
||||
* @param {array} params : String-parameters to be set in variables in phrasentext
|
||||
* @returns {String} : phrase-text
|
||||
*/
|
||||
t: function (category, phrase, params = []) {
|
||||
|
||||
// Checks if FHC_JS_PHRASES_STORAGE_OBJECT is an array
|
||||
if ($.isArray(FHC_JS_PHRASES_STORAGE_OBJECT))
|
||||
{
|
||||
// loop through global JS PHRASES STORAGE OBJECT and search for phrase
|
||||
for (i in FHC_JS_PHRASES_STORAGE_OBJECT)
|
||||
{
|
||||
var phraseObj = FHC_JS_PHRASES_STORAGE_OBJECT[i]; // Single phrase object
|
||||
|
||||
// If the single phrase match the given parameters and is not an empty string
|
||||
if (phraseObj.category == category
|
||||
&& phraseObj.phrase == phrase
|
||||
&& phraseObj.text != null
|
||||
&& phraseObj.text.trim() != '')
|
||||
{
|
||||
// If params is null or not an array
|
||||
if (params == null || (params != null && !$.isArray(params)))
|
||||
{
|
||||
params = [];
|
||||
}
|
||||
|
||||
return FHC_PhrasesLib._replacePhraseVariable(phraseObj.text, params); // parsing
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return '<< PHRASE ' + phrase + ' >>';
|
||||
},
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
/**
|
||||
* Returns phrase with variables being replaced
|
||||
* @param {String} phrase : phrasen-text (with one ore more variables)
|
||||
* @param {array} replaceStringArr : String-array to be set in variables in phrasentext (order matters)
|
||||
* @returns {String} : replaced phrasen-text
|
||||
*/
|
||||
_replacePhraseVariable: function (phrase, replaceStringArr) {
|
||||
for (var i = 0; i < replaceStringArr.length; i++)
|
||||
{
|
||||
phrase = phrase.replace(/\{(.*?)\}/, replaceStringArr[i]);
|
||||
}
|
||||
return phrase;
|
||||
}
|
||||
};
|
||||
Vendored
+4
-6
@@ -1,10 +1,8 @@
|
||||
/*
|
||||
file for adding bootstrap classes, e.g. in case usage of non-bootstrap widgets in a bootstrap page
|
||||
AVOID USING THIS IF POSSIBLE
|
||||
/**
|
||||
* To add bootstrap classes, e.g. in case usage of non-bootstrap widgets in a bootstrap page
|
||||
* NOTE: avoid using this if possible
|
||||
*/
|
||||
$(document).ready(
|
||||
function()
|
||||
{
|
||||
$(document).ready(function() {
|
||||
$("input[type=text], select").addClass("form-control");
|
||||
$("button, input[type=button]").addClass("btn btn-default");
|
||||
$("table").addClass("table-condensed");
|
||||
|
||||
@@ -1,40 +1,21 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
function getUrlParameter(sParam)
|
||||
{
|
||||
var sPageURL = decodeURIComponent(window.location.search.substring(1)),
|
||||
sURLVariables = sPageURL.split('&'),
|
||||
sParameterName,
|
||||
i;
|
||||
|
||||
for (i = 0; i < sURLVariables.length; i++)
|
||||
{
|
||||
sParameterName = sURLVariables[i].split('=');
|
||||
|
||||
if (sParameterName[0] === sParam)
|
||||
{
|
||||
return sParameterName[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var fhc_controller_id = getUrlParameter("fhc_controller_id");
|
||||
var fhc_controller_id = FHC_AjaxClient.getUrlParameter('fhc_controller_id');
|
||||
const CONTROLLER_URL = FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + "/"+FHC_JS_DATA_STORAGE_OBJECT.called_path;
|
||||
const CALLED_PATH = FHC_JS_DATA_STORAGE_OBJECT.called_path;
|
||||
|
||||
/**
|
||||
* javascript file for infocenterDetails page
|
||||
*/
|
||||
$(document).ready(
|
||||
function ()
|
||||
{
|
||||
$(document).ready(function ()
|
||||
{
|
||||
//initialise table sorter
|
||||
addTablesorter("doctable", [[2, 1], [1, 0]], ["zebra"]);
|
||||
addTablesorter("nachgdoctable", [[2, 0], [1, 1]], ["zebra"]);
|
||||
addTablesorter("msgtable", [[0, 1], [2, 0]], ["zebra", "filter"], 2);
|
||||
tablesortAddPager("msgtable", "msgpager", 10);
|
||||
Tablesort.addTablesorter("doctable", [[2, 1], [1, 0]], ["zebra"]);
|
||||
Tablesort.addTablesorter("nachgdoctable", [[2, 0], [1, 1]], ["zebra"]);
|
||||
Tablesort.addTablesorter("msgtable", [[0, 1], [2, 0]], ["zebra", "filter"], 2);
|
||||
Tablesort.tablesortAddPager("msgtable", "msgpager", 14);
|
||||
|
||||
formatNotizTable();
|
||||
formatLogTable();
|
||||
InfocenterDetails._formatNotizTable();
|
||||
InfocenterDetails._formatLogTable();
|
||||
|
||||
//initialise datepicker
|
||||
$.datepicker.setDefaults($.datepicker.regional['de']);
|
||||
@@ -42,6 +23,8 @@ $(document).ready(
|
||||
"dateFormat": "dd.mm.yy"
|
||||
});
|
||||
|
||||
var personid = $("#hiddenpersonid").val();
|
||||
|
||||
//add submit event to message send link
|
||||
$("#sendmsglink").click(
|
||||
function ()
|
||||
@@ -54,28 +37,34 @@ $(document).ready(
|
||||
$(".prchbox").click(function ()
|
||||
{
|
||||
var boxid = this.id;
|
||||
var personid = $("#hiddenpersonid").val();
|
||||
var akteid = boxid.substr(boxid.indexOf("_") + 1);
|
||||
var checked = this.checked;
|
||||
saveFormalGeprueft(personid, akteid, checked)
|
||||
InfocenterDetails.saveFormalGeprueft(personid, akteid, checked)
|
||||
});
|
||||
|
||||
//zgv übernehmen
|
||||
$(".zgvUebernehmen").click(function ()
|
||||
{
|
||||
var btn = $(this);
|
||||
var personid = $("#hiddenpersonid").val();
|
||||
var prestudentid = this.id.substr(this.id.indexOf("_") + 1);
|
||||
$('#zgvUebernehmenNotice').remove();
|
||||
zgvUebernehmen(personid, prestudentid, btn)
|
||||
InfocenterDetails.zgvUebernehmen(personid, prestudentid, btn)
|
||||
});
|
||||
|
||||
//zgv speichern
|
||||
$(".zgvform").on('submit', function (e)
|
||||
{
|
||||
e.preventDefault();
|
||||
var data = $(this).serializeArray();
|
||||
saveZgv(data);
|
||||
var formdata = $(this).serializeArray();
|
||||
|
||||
var data = {};
|
||||
|
||||
for (var i = 0; i < formdata.length; i++)
|
||||
{
|
||||
data[formdata[i].name] = formdata[i].value;
|
||||
}
|
||||
|
||||
InfocenterDetails.saveZgv(data);
|
||||
}
|
||||
);
|
||||
|
||||
@@ -83,7 +72,7 @@ $(document).ready(
|
||||
$(".zgvinfo").click(function ()
|
||||
{
|
||||
var prestudentid = this.id.substr(this.id.indexOf("_") + 1);
|
||||
openZgvInfoForPrestudent(prestudentid);
|
||||
InfocenterDetails.openZgvInfoForPrestudent(prestudentid);
|
||||
}
|
||||
);
|
||||
|
||||
@@ -112,17 +101,24 @@ $(document).ready(
|
||||
$("#notizform").on("submit", function (e)
|
||||
{
|
||||
e.preventDefault();
|
||||
var personId = $("#hiddenpersonid").val();
|
||||
var notizId = $("#notizform :input[name='hiddenNotizId']").val();
|
||||
var data = $(this).serializeArray();
|
||||
var formdata = $(this).serializeArray();
|
||||
var data = {};
|
||||
|
||||
for (var i = 0; i < formdata.length; i++)
|
||||
{
|
||||
data[formdata[i].name] = formdata[i].value;
|
||||
}
|
||||
|
||||
$("#notizmsg").empty();
|
||||
|
||||
if (notizId !== '')
|
||||
{
|
||||
updateNotiz(notizId, personId, data);
|
||||
InfocenterDetails.updateNotiz(notizId, personid, data);
|
||||
}
|
||||
else
|
||||
{
|
||||
saveNotiz(personId, data);
|
||||
InfocenterDetails.saveNotiz(personid, data);
|
||||
}
|
||||
}
|
||||
);
|
||||
@@ -130,11 +126,13 @@ $(document).ready(
|
||||
//update notiz - autofill notizform
|
||||
$(document).on("click", "#notiztable tbody tr", function ()
|
||||
{
|
||||
$("#notizmsg").empty();
|
||||
|
||||
var notizId = $(this).find("td:eq(3)").html();
|
||||
var notizTitle = $(this).find("td:eq(1)").text();
|
||||
var notizContent = this.title;
|
||||
|
||||
$("#notizform label:first").text("Notiz ändern").css("color", "red");
|
||||
$("#notizform label:first").text(FHC_PhrasesLib.t('infocenter', 'notizAendern')).css("color", "red");
|
||||
$("#notizform :input[type='reset']").css("display", "inline-block");
|
||||
|
||||
$("#notizform :input[name='hiddenNotizId']").val(notizId);
|
||||
@@ -146,206 +144,353 @@ $(document).ready(
|
||||
//update notiz - abbrechen-button: reset styles
|
||||
$("#notizform :input[type='reset']").click(function ()
|
||||
{
|
||||
resetNotizFields();
|
||||
InfocenterDetails._resetNotizFields();
|
||||
}
|
||||
);
|
||||
|
||||
//check if person is parked and display it
|
||||
InfocenterDetails.getParkedDate(personid);
|
||||
|
||||
});
|
||||
|
||||
function openZgvInfoForPrestudent(prestudent_id)
|
||||
{
|
||||
var screenwidth = screen.width;
|
||||
var popupwidth = 760;
|
||||
var marginleft = screenwidth - popupwidth;
|
||||
console.log(marginleft);
|
||||
window.open("../getZgvInfoForPrestudent/" + prestudent_id, "_blank","resizable=yes,scrollbars=yes,width="+popupwidth+",height="+screen.height+",left="+marginleft);
|
||||
}
|
||||
var InfocenterDetails = {
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// ajax calls
|
||||
genericSaveError: function() {
|
||||
alert("error when saving");
|
||||
},
|
||||
openZgvInfoForPrestudent: function(prestudent_id)
|
||||
{
|
||||
var screenwidth = screen.width;
|
||||
var popupwidth = 760;
|
||||
var marginleft = screenwidth - popupwidth;
|
||||
window.open(CONTROLLER_URL + "/getZgvInfoForPrestudent/" + encodeURIComponent(prestudent_id), "_blank","resizable=yes,scrollbars=yes,width="+popupwidth+",height="+screen.height+",left="+marginleft);
|
||||
},
|
||||
|
||||
function saveFormalGeprueft(personid, akteid, checked)
|
||||
{
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
dataType: "json",
|
||||
url: "../saveFormalGeprueft/" + personid + '?fhc_controller_id=' + fhc_controller_id,
|
||||
data: {"akte_id": akteid, "formal_geprueft": checked},
|
||||
success: function (data, textStatus, jqXHR)
|
||||
{
|
||||
if (data === null)
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// ajax calls
|
||||
saveFormalGeprueft: function(personid, akteid, checked)
|
||||
{
|
||||
FHC_AjaxClient.ajaxCallPost(
|
||||
CALLED_PATH + '/saveFormalGeprueft/' + encodeURIComponent(personid),
|
||||
{
|
||||
$("#formalgeprueftam_" + akteid).text("");
|
||||
akte_id: akteid,
|
||||
formal_geprueft: checked
|
||||
},
|
||||
{
|
||||
successCallback: function(data, textStatus, jqXHR) {
|
||||
if (data !== false)
|
||||
{
|
||||
if (data === null)
|
||||
{
|
||||
$("#formalgeprueftam_" + akteid).text("");
|
||||
}
|
||||
else
|
||||
{
|
||||
var fgdatum = $.datepicker.parseDate("yy-mm-dd", data);
|
||||
var gerfgdatum = $.datepicker.formatDate("dd.mm.yy", fgdatum);
|
||||
$("#formalgeprueftam_" + akteid).text(gerfgdatum);
|
||||
}
|
||||
//refresh doctable tablesorter, formal geprueft changed!
|
||||
$("#doctable").trigger("update");
|
||||
InfocenterDetails._refreshLog();
|
||||
}
|
||||
else
|
||||
{
|
||||
InfocenterDetails.genericSaveError();
|
||||
}
|
||||
},
|
||||
errorCallback: InfocenterDetails.genericSaveError,
|
||||
veilTimeout: 0
|
||||
}
|
||||
else
|
||||
);
|
||||
},
|
||||
zgvUebernehmen: function(personid, prestudentid, btn)
|
||||
{
|
||||
FHC_AjaxClient.ajaxCallGet(
|
||||
CALLED_PATH + "/getLastPrestudentWithZgvJson/" + encodeURIComponent(personid),
|
||||
null,
|
||||
{
|
||||
fgdatum = $.datepicker.parseDate("yy-mm-dd", data);
|
||||
gerfgdatum = $.datepicker.formatDate("dd.mm.yy", fgdatum);
|
||||
$("#formalgeprueftam_" + akteid).text(gerfgdatum);
|
||||
successCallback: function(data, textStatus, jqXHR) {
|
||||
if (FHC_AjaxClient.hasData(data))
|
||||
{
|
||||
var prestudent = data.retval[0];
|
||||
var zgvcode = prestudent.zgv_code !== null ? prestudent.zgv_code : "null";
|
||||
var zgvort = prestudent.zgvort !== null ? prestudent.zgvort : "";
|
||||
var zgvdatum = prestudent.zgvdatum;
|
||||
var gerzgvdatum = "";
|
||||
if (zgvdatum !== null)
|
||||
{
|
||||
zgvdatum = $.datepicker.parseDate("yy-mm-dd", prestudent.zgvdatum);
|
||||
gerzgvdatum = $.datepicker.formatDate("dd.mm.yy", zgvdatum);
|
||||
}
|
||||
var zgvnation = prestudent.zgvnation !== null ? prestudent.zgvnation : "null";
|
||||
$("#zgv_" + prestudentid).val(zgvcode);
|
||||
$("#zgvort_" + prestudentid).val(zgvort);
|
||||
$("#zgvdatum_" + prestudentid).val(gerzgvdatum);
|
||||
$("#zgvnation_" + prestudentid).val(zgvnation);
|
||||
}
|
||||
else
|
||||
{
|
||||
btn.after(" <span id='zgvUebernehmenNotice' class='text-warning'>keine ZGV vorhanden</span>");
|
||||
}
|
||||
},
|
||||
veilTimeout: 0
|
||||
}
|
||||
//refresh doctable tablesorter, formal geprueft changed!
|
||||
$("#doctable").trigger("update");
|
||||
refreshLog();
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown)
|
||||
{
|
||||
alert(textStatus + " - " + errorThrown + " - " + jqXHR.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
);
|
||||
},
|
||||
saveZgv: function(data)
|
||||
{
|
||||
var zgvError = function(){
|
||||
$("#zgvSpeichern_" + prestudentid).before("<span id='zgvSpeichernNotice' class='text-danger'>" + FHC_PhrasesLib.t('ui', 'fehlerBeimSpeichern') + "</span> ");
|
||||
};
|
||||
|
||||
function zgvUebernehmen(personid, prestudentid, btn)
|
||||
{
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
dataType: "json",
|
||||
url: "../getLastPrestudentWithZgvJson/" + personid + '?fhc_controller_id=' + fhc_controller_id,
|
||||
success: function (data, textStatus, jqXHR)
|
||||
{
|
||||
if (data !== null)
|
||||
var prestudentid = data.prestudentid;
|
||||
$("#zgvSpeichernNotice").remove();
|
||||
|
||||
FHC_AjaxClient.ajaxCallPost(
|
||||
CALLED_PATH + '/saveZgvPruefung',
|
||||
data,
|
||||
{
|
||||
var zgvcode = data.zgv_code !== null ? data.zgv_code : "null";
|
||||
var zgvort = data.zgvort !== null ? data.zgvort : "";
|
||||
var zgvdatum = data.zgvdatum;
|
||||
var gerzgvdatum = "";
|
||||
if (zgvdatum !== null)
|
||||
successCallback: function(data, textStatus, jqXHR) {
|
||||
|
||||
if (FHC_AjaxClient.hasData(data))
|
||||
{
|
||||
InfocenterDetails._refreshLog();
|
||||
$("#zgvSpeichern_" + prestudentid).before("<span id='zgvSpeichernNotice' class='text-success'>" + FHC_PhrasesLib.t('ui', 'gespeichert') + "</span> ");
|
||||
}
|
||||
else
|
||||
{
|
||||
zgvError();
|
||||
}
|
||||
},
|
||||
errorCallback: zgvError,
|
||||
veilTimeout: 0
|
||||
}
|
||||
);
|
||||
},
|
||||
saveNotiz: function(personid, data)
|
||||
{
|
||||
FHC_AjaxClient.ajaxCallPost(
|
||||
CALLED_PATH + '/saveNotiz/' + encodeURIComponent(personid),
|
||||
data,
|
||||
{
|
||||
successCallback: function(data, textStatus, jqXHR) {
|
||||
if (FHC_AjaxClient.hasData(data))
|
||||
{
|
||||
InfocenterDetails._refreshNotizen();
|
||||
InfocenterDetails._refreshLog();
|
||||
}
|
||||
else
|
||||
{
|
||||
InfocenterDetails._errorSaveNotiz();
|
||||
}
|
||||
},
|
||||
errorCallback: InfocenterDetails._errorSaveNotiz,
|
||||
veilTimeout: 0
|
||||
}
|
||||
);
|
||||
},
|
||||
updateNotiz: function(notizId, personId, data)
|
||||
{
|
||||
FHC_AjaxClient.ajaxCallPost(
|
||||
CALLED_PATH + '/updateNotiz/' + encodeURIComponent(notizId) + "/" + encodeURIComponent(personId),
|
||||
data,
|
||||
{
|
||||
successCallback: function(data, textStatus, jqXHR) {
|
||||
if (FHC_AjaxClient.hasData(data))
|
||||
{
|
||||
InfocenterDetails._refreshNotizen();
|
||||
InfocenterDetails._refreshLog();
|
||||
InfocenterDetails._resetNotizFields();
|
||||
}
|
||||
else
|
||||
{
|
||||
InfocenterDetails._errorSaveNotiz();
|
||||
}
|
||||
},
|
||||
errorCallback: InfocenterDetails._errorSaveNotiz,
|
||||
veilTimeout: 0
|
||||
}
|
||||
);
|
||||
},
|
||||
getStudienjahrEnd: function()
|
||||
{
|
||||
FHC_AjaxClient.ajaxCallGet(
|
||||
CALLED_PATH + "/getStudienjahrEnd",
|
||||
null,
|
||||
{
|
||||
successCallback: function(data, textStatus, jqXHR) {
|
||||
if (data)
|
||||
{
|
||||
var engdate = $.datepicker.parseDate("yy-mm-dd", data);
|
||||
var gerdate = $.datepicker.formatDate("dd.mm.yy", engdate);
|
||||
$("#parkdate").val(gerdate);
|
||||
}
|
||||
},
|
||||
veilTimeout: 0
|
||||
}
|
||||
);
|
||||
},
|
||||
getParkedDate: function(personid)
|
||||
{
|
||||
FHC_AjaxClient.ajaxCallGet(
|
||||
CALLED_PATH + "/getParkedDate/"+encodeURIComponent(personid),
|
||||
null,
|
||||
{
|
||||
successCallback: function(data, textStatus, jqXHR) {
|
||||
InfocenterDetails._refreshParking(data);
|
||||
InfocenterDetails._refreshLog();
|
||||
if (data === null)
|
||||
InfocenterDetails.getStudienjahrEnd();
|
||||
},
|
||||
veilTimeout: 0
|
||||
}
|
||||
);
|
||||
},
|
||||
parkPerson: function(personid, date)
|
||||
{
|
||||
var parkError = function(){
|
||||
$("#parkmsg").text(" Fehler beim Parken!");
|
||||
};
|
||||
|
||||
FHC_AjaxClient.ajaxCallPost(
|
||||
CALLED_PATH + '/park',
|
||||
{
|
||||
"person_id": personid,
|
||||
"parkdate": date
|
||||
},
|
||||
{
|
||||
successCallback: function(data, textStatus, jqXHR) {
|
||||
if (FHC_AjaxClient.hasData(data))
|
||||
InfocenterDetails.getParkedDate(personid);
|
||||
else
|
||||
{
|
||||
parkError();
|
||||
}
|
||||
},
|
||||
errorCallback: parkError,
|
||||
veilTimeout: 0
|
||||
}
|
||||
);
|
||||
},
|
||||
unparkPerson: function(personid)
|
||||
{
|
||||
FHC_AjaxClient.ajaxCallPost(
|
||||
CALLED_PATH + '/unpark',
|
||||
{
|
||||
"person_id": personid
|
||||
},
|
||||
{
|
||||
successCallback: function(data, textStatus, jqXHR) {
|
||||
if (Array.isArray(data))
|
||||
{
|
||||
if (data.length > 0)
|
||||
InfocenterDetails.getParkedDate(personid);
|
||||
else
|
||||
$("#unparkmsg").removeClass().addClass("text-warning").text(FHC_PhrasesLib.t('infocenter', 'nichtsZumAusparken'));
|
||||
}
|
||||
},
|
||||
errorCallback: function(){
|
||||
$("#unparkmsg").removeClass().addClass("text-danger").text(FHC_PhrasesLib.t('infocenter', 'fehlerBeimAusparken'));
|
||||
},
|
||||
veilTimeout: 0
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// (private) methods executed after ajax (refreshers)
|
||||
_refreshLog: function()
|
||||
{
|
||||
var personid = $("#hiddenpersonid").val();
|
||||
$("#logs").load(CONTROLLER_URL + '/reloadLogs/' + personid + '?fhc_controller_id=' + fhc_controller_id,
|
||||
function ()
|
||||
{
|
||||
//readd tablesorter
|
||||
InfocenterDetails._formatLogTable()
|
||||
}
|
||||
);
|
||||
},
|
||||
_formatLogTable: function()
|
||||
{
|
||||
Tablesort.addTablesorter("logtable", [[0, 1]], ["filter"], 2);
|
||||
Tablesort.tablesortAddPager("logtable", "logpager", 22);
|
||||
$("#logtable").addClass("table-condensed");
|
||||
},
|
||||
_refreshNotizen: function()
|
||||
{
|
||||
$("#notizform").find("input[type=text], textarea").val("");
|
||||
var personid = $("#hiddenpersonid").val();
|
||||
$("#notizen").load(CONTROLLER_URL + '/reloadNotizen/' + personid,
|
||||
function ()
|
||||
{
|
||||
//readd tablesorter
|
||||
InfocenterDetails._formatNotizTable()
|
||||
}
|
||||
);
|
||||
},
|
||||
_refreshParking: function(date)
|
||||
{
|
||||
if (date === null)
|
||||
{
|
||||
$("#parking").html(
|
||||
'<div class="form-group form-inline">'+
|
||||
'<button class="btn btn-default" id="parklink" type="button""><i class="fa fa-clock-o"></i> ' + FHC_PhrasesLib.t('infocenter', 'bewerberParken') + '</button> '+
|
||||
FHC_PhrasesLib.t('global', 'bis') + ' '+
|
||||
'<input id="parkdate" type="text" class="form-control" placeholder="Parkdatum" style="height: 25px; width: 99px"> '+
|
||||
'<span class="text-danger" id="parkmsg"></span>'+
|
||||
'</div>');
|
||||
|
||||
$("#parkdate").datepicker({
|
||||
"dateFormat": "dd.mm.yy",
|
||||
"minDate": 0
|
||||
});
|
||||
|
||||
$("#parklink").click(
|
||||
|
||||
function ()
|
||||
{
|
||||
zgvdatum = $.datepicker.parseDate("yy-mm-dd", data.zgvdatum);
|
||||
gerzgvdatum = $.datepicker.formatDate("dd.mm.yy", zgvdatum);
|
||||
var personid = $("#hiddenpersonid").val();
|
||||
var date = $("#parkdate").val();
|
||||
|
||||
InfocenterDetails.parkPerson(personid, date);
|
||||
}
|
||||
var zgvnation = data.zgvnation !== null ? data.zgvnation : "null";
|
||||
$("#zgv_" + prestudentid).val(zgvcode);
|
||||
$("#zgvort_" + prestudentid).val(zgvort);
|
||||
$("#zgvdatum_" + prestudentid).val(gerzgvdatum);
|
||||
$("#zgvnation_" + prestudentid).val(zgvnation);
|
||||
}
|
||||
else
|
||||
{
|
||||
btn.after(" <span id='zgvUebernehmenNotice' class='text-warning'>keine ZGV vorhanden</span>");
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown)
|
||||
{
|
||||
alert(textStatus + " - " + errorThrown + " - " + jqXHR.responseText);
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
var parkdate = $.datepicker.parseDate("yy-mm-dd", date);
|
||||
var gerparkdate = $.datepicker.formatDate("dd.mm.yy", parkdate);
|
||||
$("#parking").html(
|
||||
FHC_PhrasesLib.t('infocenter', 'bewerberGeparktBis')+' '+gerparkdate+' '+
|
||||
'<button class="btn btn-default" id="unparklink"><i class="fa fa-sign-out"></i> '+FHC_PhrasesLib.t('infocenter', 'bewerberAusparken')+'</button> '+
|
||||
'<span id="unparkmsg"></span>'
|
||||
);
|
||||
|
||||
function saveZgv(data)
|
||||
{
|
||||
var prestudentid = data[0].value;
|
||||
$("#zgvSpeichernNotice").remove();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
dataType: "json",
|
||||
data: data,
|
||||
url: "../saveZgvPruefung/" + prestudentid + '?fhc_controller_id=' + fhc_controller_id,
|
||||
success: function (data, textStatus, jqXHR)
|
||||
{
|
||||
if (data === prestudentid)
|
||||
{
|
||||
refreshLog();
|
||||
$("#zgvSpeichern_" + prestudentid).before("<span id='zgvSpeichernNotice' class='text-success'>ZGV erfolgreich gespeichert!</span> ");
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#zgvSpeichern_" + prestudentid).before("<span id='zgvSpeichernNotice' class='text-danger'>Fehler beim Speichern der ZGV!</span> ");
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown)
|
||||
{
|
||||
alert(textStatus + " - " + errorThrown + " - " + jqXHR.responseText);
|
||||
$("#unparklink").click(
|
||||
function ()
|
||||
{
|
||||
var personid = $("#hiddenpersonid").val();
|
||||
InfocenterDetails.unparkPerson(personid, date);
|
||||
}
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function saveNotiz(personid, data)
|
||||
{
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
dataType: "json",
|
||||
data: data,
|
||||
url: "../saveNotiz/" + personid + '?fhc_controller_id=' + fhc_controller_id,
|
||||
success: function (data, textStatus, jqXHR)
|
||||
{
|
||||
refreshNotizen();
|
||||
refreshLog();
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown)
|
||||
{
|
||||
alert(textStatus + " - " + errorThrown + " - " + jqXHR.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function updateNotiz(notizId, personId, data)
|
||||
{
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
dataType: "json",
|
||||
data: data,
|
||||
url: "../updateNotiz/" + notizId + "/" + personId + '?fhc_controller_id=' + fhc_controller_id,
|
||||
success: function (data, textStatus, jqXHR)
|
||||
{
|
||||
if (data)
|
||||
{
|
||||
refreshNotizen();
|
||||
refreshLog();
|
||||
resetNotizFields();
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown)
|
||||
{
|
||||
alert(textStatus + " - " + errorThrown + " - " + jqXHR.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// methods executed after ajax (refreshers)
|
||||
|
||||
function refreshLog()
|
||||
{
|
||||
var personid = $("#hiddenpersonid").val();
|
||||
$("#logs").load('../reloadLogs/' + personid,
|
||||
function ()
|
||||
{
|
||||
//readd tablesorter
|
||||
formatLogTable()
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function formatLogTable()
|
||||
{
|
||||
addTablesorter("logtable", [[0, 1]], ["filter"], 2);
|
||||
tablesortAddPager("logtable", "logpager", 23);
|
||||
$("#logtable").addClass("table-condensed");
|
||||
}
|
||||
|
||||
function refreshNotizen()
|
||||
{
|
||||
$("#notizform").find("input[type=text], textarea").val("");
|
||||
var personid = $("#hiddenpersonid").val();
|
||||
$("#notizen").load('../reloadNotizen/' + personid,
|
||||
function ()
|
||||
{
|
||||
//readd tablesorter
|
||||
formatNotizTable()
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function formatNotizTable()
|
||||
{
|
||||
addTablesorter("notiztable", [[0, 1]], ["filter"], 2);
|
||||
tablesortAddPager("notiztable", "notizpager", 10);
|
||||
$("#notiztable").addClass("table-condensed");
|
||||
}
|
||||
|
||||
function resetNotizFields()
|
||||
{
|
||||
$("#notizform :input[name='hiddenNotizId']").val("");
|
||||
$("#notizform label:first").text("Notiz hinzufügen").css("color", "black");
|
||||
$("#notizform :input[type='reset']").css("display", "none");
|
||||
}
|
||||
},
|
||||
_formatNotizTable: function()
|
||||
{
|
||||
Tablesort.addTablesorter("notiztable", [[0, 1]], ["filter"], 2);
|
||||
Tablesort.tablesortAddPager("notiztable", "notizpager", 11);
|
||||
$("#notiztable").addClass("table-condensed");
|
||||
},
|
||||
_resetNotizFields: function()
|
||||
{
|
||||
$("#notizmsg").empty();
|
||||
$("#notizform :input[name='hiddenNotizId']").val("");
|
||||
$("#notizform label:first").text(FHC_PhrasesLib.t('infocenter', 'notizHinzufuegen')).css("color", "black");
|
||||
$("#notizform :input[type='reset']").css("display", "none");
|
||||
},
|
||||
_errorSaveNotiz: function()
|
||||
{
|
||||
$("#notizmsg").text(FHC_PhrasesLib.t('ui', 'fehlerBeimSpeichern'));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,104 +1,24 @@
|
||||
/**
|
||||
* Javascript file for infocenter overview page
|
||||
*/
|
||||
$(document).ready(function() {
|
||||
|
||||
appendTableActionsHtml();
|
||||
// setTableActions();
|
||||
|
||||
});
|
||||
|
||||
/**
|
||||
* adds person table additional actions html (above and beneath it)
|
||||
*/
|
||||
function appendTableActionsHtml()
|
||||
* Refreshes the side menu
|
||||
* NOTE: it is called from the FilterWidget therefore must be a global function
|
||||
*/
|
||||
function refreshSideMenu()
|
||||
{
|
||||
var currurl = window.location.href;
|
||||
var url = currurl.replace(/infocenter\/InfoCenter(.*)/, "Messages/write");
|
||||
|
||||
var formHtml = '<form id="sendMsgsForm" method="post" action="'+ url +'" target="_blank"></form>';
|
||||
$("#datasetActionsTop").before(formHtml);
|
||||
|
||||
var selectAllHtml =
|
||||
'<a href="javascript:void(0)" class="selectAll">' +
|
||||
'<i class="fa fa-check"></i> Alle</a> ' +
|
||||
'<a href="javascript:void(0)" class="unselectAll">' +
|
||||
'<i class="fa fa-times"></i> Keinen</a> ';
|
||||
|
||||
var messageHtml = 'Mit Ausgewählten: ' +
|
||||
'<a href="javascript:void(0)" class="sendMsgsLink">' +
|
||||
'<i class="fa fa-envelope"></i> Nachricht senden</a>';
|
||||
|
||||
var personcount = 0;
|
||||
|
||||
$.ajax({
|
||||
url: window.location.pathname.replace('infocenter/InfoCenter', 'Filters/rowNumber'),
|
||||
method: "GET",
|
||||
data: {
|
||||
fhc_controller_id: getUrlParameter("fhc_controller_id")
|
||||
},
|
||||
dataType: "json"
|
||||
})
|
||||
.done(function(data, textStatus, jqXHR) {
|
||||
|
||||
if (data != null)
|
||||
//
|
||||
FHC_AjaxClient.ajaxCallGet(
|
||||
'system/infocenter/InfoCenter/setNavigationMenuArrayJson',
|
||||
null,
|
||||
{
|
||||
if (data.rowNumber != null)
|
||||
{
|
||||
personcount = data.rowNumber;
|
||||
|
||||
var persontext = personcount === 1 ? "Person" : "Personen";
|
||||
var countHtml = personcount + " " + persontext;
|
||||
|
||||
$("#datasetActionsTop, #datasetActionsBottom").append(
|
||||
"<div class='pull-left'>" + selectAllHtml + " " + messageHtml + "</div>"+
|
||||
"<div class='pull-right'>" + countHtml + "</div>"+
|
||||
"<div class='clearfix'></div>"
|
||||
);
|
||||
$("#datasetActionsBottom").append("<br><br>");
|
||||
successCallback: function(data, textStatus, jqXHR) {
|
||||
FHC_NavigationWidget.renderSideMenu();
|
||||
},
|
||||
errorCallback: function(jqXHR, textStatus, errorThrown) {
|
||||
alert(textStatus);
|
||||
}
|
||||
|
||||
setTableActions();
|
||||
}
|
||||
|
||||
}).fail(function(jqXHR, textStatus, errorThrown) {
|
||||
alert(textStatus);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* sets functionality for the actions above and beneath the person table
|
||||
*/
|
||||
function setTableActions()
|
||||
{
|
||||
$(".sendMsgsLink").click(function() {
|
||||
var idsel = $("#filterTableDataset input:checked[name=PersonId\\[\\]]");
|
||||
if(idsel.length > 0)
|
||||
{
|
||||
var form = $("#sendMsgsForm");
|
||||
form.find("input[type=hidden]").remove();
|
||||
for (var i = 0; i < idsel.length; i++)
|
||||
{
|
||||
var id = $(idsel[i]).val();
|
||||
form.append("<input type='hidden' name='person_id[]' value='" + id + "'>");
|
||||
}
|
||||
form.submit();
|
||||
}
|
||||
});
|
||||
|
||||
$(".selectAll").click(function()
|
||||
{
|
||||
//select only trs if not filtered by tablesorter
|
||||
var trs = $("#filterTableDataset tbody tr").not(".filtered");
|
||||
trs.find("input[name=PersonId\\[\\]]").prop("checked", true);
|
||||
}
|
||||
);
|
||||
|
||||
$(".unselectAll").click(function()
|
||||
{
|
||||
var trs = $("#filterTableDataset tbody tr").not(".filtered");
|
||||
trs.find("input[name=PersonId\\[\\]]").prop("checked", false);
|
||||
}
|
||||
);
|
||||
}
|
||||
@@ -106,41 +26,115 @@ function setTableActions()
|
||||
/**
|
||||
*
|
||||
*/
|
||||
function getUrlParameter(sParam)
|
||||
{
|
||||
var sPageURL = decodeURIComponent(window.location.search.substring(1)),
|
||||
sURLVariables = sPageURL.split('&'),
|
||||
sParameterName,
|
||||
i;
|
||||
var InfocenterPersonDataset = {
|
||||
|
||||
for (i = 0; i < sURLVariables.length; i++)
|
||||
/**
|
||||
* adds person table additional actions html (above and beneath it)
|
||||
/*
|
||||
*/
|
||||
appendTableActionsHtml: function()
|
||||
{
|
||||
sParameterName = sURLVariables[i].split('=');
|
||||
var currurl = window.location.href;
|
||||
var url = currurl.replace(/infocenter\/InfoCenter(.*)/, "Messages/write");
|
||||
|
||||
if (sParameterName[0] === sParam)
|
||||
{
|
||||
return sParameterName[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
var formHtml = '<form id="sendMsgsForm" method="post" action="'+ url +'" target="_blank"></form>';
|
||||
$("#datasetActionsTop").before(formHtml);
|
||||
|
||||
var selectAllHtml =
|
||||
'<a href="javascript:void(0)" class="selectAll">' +
|
||||
'<i class="fa fa-check"></i> Alle</a> ' +
|
||||
'<a href="javascript:void(0)" class="unselectAll">' +
|
||||
'<i class="fa fa-times"></i> Keinen</a> ';
|
||||
|
||||
var actionHtml = 'Mit Ausgewählten: ' +
|
||||
'<a href="javascript:void(0)" class="sendMsgsLink">' +
|
||||
'<i class="fa fa-envelope"></i> Nachricht senden</a>';
|
||||
|
||||
var legendHtml = '<i class="fa fa-circle text-danger"></i> Gesperrt ' +
|
||||
'<i class="fa fa-circle text-info"></i> Geparkt';
|
||||
|
||||
var personcount = 0;
|
||||
|
||||
FHC_AjaxClient.ajaxCallGet(
|
||||
'system/Filters/rowNumber',
|
||||
{
|
||||
filter_page: FHC_FilterWidget.getFilterPage()
|
||||
},
|
||||
{
|
||||
successCallback: function(data, textStatus, jqXHR) {
|
||||
if (FHC_AjaxClient.hasData(data))
|
||||
{
|
||||
personcount = FHC_AjaxClient.getData(data);
|
||||
|
||||
if (personcount > 0)
|
||||
{
|
||||
var persontext = personcount === 1 ? "Person" : "Personen";
|
||||
var countHtml = personcount + " " + persontext;
|
||||
|
||||
$("#datasetActionsTop, #datasetActionsBottom").append(
|
||||
"<div class='row'>"+
|
||||
"<div class='col-xs-6'>" + selectAllHtml + " " + actionHtml + "</div>"+
|
||||
"<div class='col-xs-4'>" + legendHtml + "</div>"+
|
||||
"<div class='col-xs-2 text-right'>" + countHtml + "</div>"+
|
||||
"<div class='clearfix'></div>"+
|
||||
"</div>"
|
||||
);
|
||||
$("#datasetActionsBottom").append("<br><br>");
|
||||
|
||||
InfocenterPersonDataset.setTableActions();
|
||||
}
|
||||
}
|
||||
},
|
||||
errorCallback: function(jqXHR, textStatus, errorThrown) {
|
||||
alert(textStatus);
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
/**
|
||||
* sets functionality for the actions above and beneath the person table
|
||||
*/
|
||||
setTableActions: function()
|
||||
{
|
||||
$(".sendMsgsLink").click(function() {
|
||||
var idsel = $("#filterTableDataset input:checked[name=PersonId\\[\\]]");
|
||||
if(idsel.length > 0)
|
||||
{
|
||||
var form = $("#sendMsgsForm");
|
||||
form.find("input[type=hidden]").remove();
|
||||
for (var i = 0; i < idsel.length; i++)
|
||||
{
|
||||
var id = $(idsel[i]).val();
|
||||
form.append("<input type='hidden' name='person_id[]' value='" + id + "'>");
|
||||
}
|
||||
form.submit();
|
||||
}
|
||||
});
|
||||
|
||||
$(".selectAll").click(function()
|
||||
{
|
||||
//select only trs if not filtered by tablesorter
|
||||
var trs = $("#filterTableDataset tbody tr").not(".filtered");
|
||||
trs.find("input[name=PersonId\\[\\]]").prop("checked", true);
|
||||
}
|
||||
);
|
||||
|
||||
$(".unselectAll").click(function()
|
||||
{
|
||||
var trs = $("#filterTableDataset tbody tr").not(".filtered");
|
||||
trs.find("input[name=PersonId\\[\\]]").prop("checked", false);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* Refreshes the side menu
|
||||
* When JQuery is up
|
||||
*/
|
||||
function refreshSideMenu()
|
||||
{
|
||||
$.ajax({
|
||||
url: window.location.pathname+"/setNavigationMenuArray",
|
||||
method: "GET",
|
||||
data: {
|
||||
fhc_controller_id: getUrlParameter("fhc_controller_id")
|
||||
}
|
||||
})
|
||||
.done(function(data, textStatus, jqXHR) {
|
||||
$(document).ready(function() {
|
||||
|
||||
renderSideMenu();
|
||||
InfocenterPersonDataset.appendTableActionsHtml();
|
||||
|
||||
}).fail(function(jqXHR, textStatus, errorThrown) {
|
||||
alert(textStatus);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,67 +1,69 @@
|
||||
/**
|
||||
* adds tablesorter to specified tableid, german date format, default theme
|
||||
* @param tableid
|
||||
* @param sortList columns to sort by, as array of arrays (each array contains column number and 1/0 for asc/desc order)
|
||||
* @param widgets optional widgets like zebra or filter
|
||||
* @param minrows optional minimal amount of rows for filter row to be shown (only relevant for filter widget)
|
||||
*/
|
||||
function addTablesorter(tableid, sortList, widgets, minrows)
|
||||
{
|
||||
$("#" + tableid).tablesorter(
|
||||
{
|
||||
theme: "default",
|
||||
dateFormat: "ddmmyyyy",
|
||||
sortList: sortList,
|
||||
widgets: widgets
|
||||
}
|
||||
);
|
||||
|
||||
if($("#" + tableid + " tr.tablesorter-filter-row").length)
|
||||
var Tablesort = {
|
||||
/**
|
||||
* adds tablesorter to specified tableid, german date format, default theme
|
||||
* @param tableid
|
||||
* @param sortList columns to sort by, as array of arrays (each array contains column number and 1/0 for asc/desc order)
|
||||
* @param widgets optional widgets like zebra or filter
|
||||
* @param minrows optional minimal amount of rows for filter row to be shown (only relevant for filter widget)
|
||||
*/
|
||||
addTablesorter: function (tableid, sortList, widgets, minrows)
|
||||
{
|
||||
//hide filters if less than n datarows (+ 2 for headings and filter row itself), default 0
|
||||
var minrows = minrows || 0;
|
||||
if ($("#" + tableid + " tr").length < minrows + 2)
|
||||
{
|
||||
$("#" + tableid + " tr.tablesorter-filter-row").hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* adds pager for specified tableid. Assumes bootstap icons are available!
|
||||
* @param tableid
|
||||
* @param pagerid
|
||||
* @param size number of rows for each page
|
||||
*/
|
||||
function tablesortAddPager(tableid, pagerid, size)
|
||||
{
|
||||
var html =
|
||||
'<div id="' + pagerid + '" class="pager"> ' +
|
||||
'<form class="form-inline">' +
|
||||
'<i class="fa fa-step-backward first"></i> ' +
|
||||
'<i class="fa fa-backward prev"></i>' +
|
||||
'<span class="pagedisplay"></span>' +
|
||||
'<i class="fa fa-forward next"></i> ' +
|
||||
'<i class="fa fa-step-forward last"></i>' +
|
||||
'</form>' +
|
||||
'</div>';
|
||||
|
||||
var rowcount = $("#" + tableid + " tr").length;
|
||||
|
||||
//not show pager if only one table page
|
||||
if (rowcount > size)
|
||||
{
|
||||
var table = $("#" + tableid);
|
||||
table.after(html);
|
||||
|
||||
table.tablesorterPager(
|
||||
$("#" + tableid).tablesorter(
|
||||
{
|
||||
container: $("#" + pagerid),
|
||||
size: size,
|
||||
cssDisabled: 'disabled',
|
||||
savePages: false,
|
||||
output: '{startRow} – {endRow} / {totalRows} Zeilen'
|
||||
theme: "default",
|
||||
dateFormat: "ddmmyyyy",
|
||||
sortList: sortList,
|
||||
widgets: widgets
|
||||
}
|
||||
);
|
||||
|
||||
if ($("#" + tableid + " tr.tablesorter-filter-row").length)
|
||||
{
|
||||
//hide filters if less than n datarows (+ 2 for headings and filter row itself), default 0
|
||||
var minrows = minrows || 0;
|
||||
if ($("#" + tableid + " tr").length < minrows + 2)
|
||||
{
|
||||
$("#" + tableid + " tr.tablesorter-filter-row").hide();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* adds pager for specified tableid. Assumes bootstap icons are available!
|
||||
* @param tableid
|
||||
* @param pagerid
|
||||
* @param size number of rows for each page
|
||||
*/
|
||||
tablesortAddPager: function (tableid, pagerid, size)
|
||||
{
|
||||
var html =
|
||||
'<div id="' + pagerid + '" class="pager"> ' +
|
||||
'<form class="form-inline">' +
|
||||
'<i class="fa fa-step-backward first"></i> ' +
|
||||
'<i class="fa fa-backward prev"></i>' +
|
||||
'<span class="pagedisplay"></span>' +
|
||||
'<i class="fa fa-forward next"></i> ' +
|
||||
'<i class="fa fa-step-forward last"></i>' +
|
||||
'</form>' +
|
||||
'</div>';
|
||||
|
||||
var rowcount = $("#" + tableid + " tbody tr").length;
|
||||
|
||||
//not show pager if only one table page
|
||||
if (rowcount > size)
|
||||
{
|
||||
var table = $("#" + tableid);
|
||||
table.after(html);
|
||||
|
||||
table.tablesorterPager(
|
||||
{
|
||||
container: $("#" + pagerid),
|
||||
size: size,
|
||||
cssDisabled: 'disabled',
|
||||
savePages: false,
|
||||
output: '{startRow} – {endRow} / {totalRows} ' + FHC_PhrasesLib.t('global', 'zeilen')
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -344,7 +344,7 @@ if (isset($_REQUEST["xmlformat"]) && $_REQUEST["xmlformat"] == "xml")
|
||||
}
|
||||
}
|
||||
|
||||
$qry = "SELECT von, bis FROM bis.tbl_bisio WHERE student_uid=".$db->db_add_param($uid_arr[$i]);
|
||||
$qry = "SELECT von, bis, lehreinheit_id FROM bis.tbl_bisio WHERE student_uid=".$db->db_add_param($uid_arr[$i]);
|
||||
if($db->db_query($qry))
|
||||
{
|
||||
if($db->db_num_rows()>0)
|
||||
@@ -534,31 +534,6 @@ if (isset($_REQUEST["xmlformat"]) && $_REQUEST["xmlformat"] == "xml")
|
||||
echo " <gradePrevLastYearNb>".sprintf("%01.1f",($noteArrayPrev[7]/$noten_anzahl*100))."</gradePrevLastYearNb>";
|
||||
echo " <gradePrevLastYearEa>".sprintf("%01.1f",($noteArrayPrev[12]/$noten_anzahl*100))."</gradePrevLastYearEa>";
|
||||
|
||||
//Projektarbeiten
|
||||
$qry_projektarbeit = "
|
||||
SELECT
|
||||
lehrveranstaltung_id, titel, themenbereich, note, titel_english
|
||||
FROM
|
||||
lehre.tbl_projektarbeit
|
||||
JOIN lehre.tbl_lehreinheit USING(lehreinheit_id)
|
||||
WHERE
|
||||
student_uid=".$db->db_add_param($uid_arr[$i])."
|
||||
AND projekttyp_kurzbz in('Bachelor', 'Diplom')
|
||||
ORDER BY beginn ASC, projektarbeit_id ASC;";
|
||||
|
||||
$projektarbeit = array();
|
||||
|
||||
if($result_projektarbeit = $db->db_query($qry_projektarbeit))
|
||||
{
|
||||
while($row_projektarbeit = $db->db_fetch_object($result_projektarbeit))
|
||||
{
|
||||
$projektarbeit[$row_projektarbeit->lehrveranstaltung_id]['titel']=$row_projektarbeit->titel;
|
||||
$projektarbeit[$row_projektarbeit->lehrveranstaltung_id]['titel_en']=$row_projektarbeit->titel_english;
|
||||
$projektarbeit[$row_projektarbeit->lehrveranstaltung_id]['themenbereich']=$row_projektarbeit->themenbereich;
|
||||
$projektarbeit[$row_projektarbeit->lehrveranstaltung_id]['note']=$row_projektarbeit->note;
|
||||
}
|
||||
}
|
||||
|
||||
$ects_total = 0;
|
||||
|
||||
echo "<studiensemester>";
|
||||
@@ -615,6 +590,7 @@ if (isset($_REQUEST["xmlformat"]) && $_REQUEST["xmlformat"] == "xml")
|
||||
echo " <semesterKurzbz>Semester $start | $semester_kurzbz</semesterKurzbz>";
|
||||
|
||||
// alle lvs im semester holen
|
||||
// Ohne LVs an denen ein Auslandssemester haengt. Diese werden spaeter separat geholt
|
||||
$qry ="
|
||||
SELECT
|
||||
distinct(tbl_lehrveranstaltung.lehrveranstaltung_id),
|
||||
@@ -631,6 +607,10 @@ if (isset($_REQUEST["xmlformat"]) && $_REQUEST["xmlformat"] == "xml")
|
||||
student_uid = ".$db->db_add_param($uid_arr[$i])."
|
||||
AND zeugnis = true
|
||||
AND studiensemester_kurzbz in (".$sqlStudent->implode4SQL($aktuellesSemester).")
|
||||
AND NOT EXISTS(SELECT 1 FROM bis.tbl_bisio JOIN lehre.tbl_lehreinheit USING(lehreinheit_id)
|
||||
WHERE lehrveranstaltung_id=tbl_lehrveranstaltung.lehrveranstaltung_id
|
||||
AND student_uid=".$db->db_add_param($uid_arr[$i])."
|
||||
AND tbl_lehreinheit.studiensemester_kurzbz in(".$sqlStudent->implode4SQL($aktuellesSemester)."))
|
||||
ORDER BY sort, tbl_lehrveranstaltung.bezeichnung;";
|
||||
|
||||
$arrayLvAusbildungssemester= array();
|
||||
@@ -774,6 +754,7 @@ if (isset($_REQUEST["xmlformat"]) && $_REQUEST["xmlformat"] == "xml")
|
||||
}
|
||||
|
||||
// Check ob an Lehrveranstaltung eine Thesis hängt
|
||||
// Aber kein Auslandssemester war, sonst wirds spaeter hinzugefügt
|
||||
$qry = "
|
||||
SELECT
|
||||
lehrveranstaltung_id, titel, themenbereich, note, titel_english
|
||||
@@ -784,6 +765,11 @@ if (isset($_REQUEST["xmlformat"]) && $_REQUEST["xmlformat"] == "xml")
|
||||
student_uid=".$db->db_add_param($uid_arr[$i])."
|
||||
AND projekttyp_kurzbz in('Bachelor', 'Diplom')
|
||||
AND lehrveranstaltung_id=".$db->db_add_param($row_stud->lehrveranstaltung_id)."
|
||||
AND NOT EXISTS(SELECT 1
|
||||
FROM bis.tbl_bisio
|
||||
JOIN lehre.tbl_lehreinheit USING(lehreinheit_id)
|
||||
WHERE lehrveranstaltung_id=".$db->db_add_param($row_stud->lehrveranstaltung_id)."
|
||||
AND student_uid=".$db->db_add_param($uid_arr[$i]).")
|
||||
ORDER BY beginn DESC, projektarbeit_id DESC LIMIT 1;";
|
||||
|
||||
if($result_thesis = $db->db_query($qry))
|
||||
@@ -836,7 +822,10 @@ if (isset($_REQUEST["xmlformat"]) && $_REQUEST["xmlformat"] == "xml")
|
||||
$qry_outgoing = "
|
||||
SELECT
|
||||
studiensemester_kurzbz, ort, ects, semesterstunden, von, bis,
|
||||
universitaet, lehrveranstaltung_id, tbl_lehrveranstaltung.sws
|
||||
universitaet, lehrveranstaltung_id, tbl_lehrveranstaltung.sws,
|
||||
(SELECT titel_english FROM lehre.tbl_projektarbeit
|
||||
WHERE lehreinheit_id=tbl_bisio.lehreinheit_id
|
||||
AND student_uid = ".$db->db_add_param($uid_arr[$i])." limit 1) as projektarbeitstitel
|
||||
FROM
|
||||
bis.tbl_bisio
|
||||
JOIN lehre.tbl_lehreinheit USING(lehreinheit_id)
|
||||
@@ -905,6 +894,13 @@ if (isset($_REQUEST["xmlformat"]) && $_REQUEST["xmlformat"] == "xml")
|
||||
break;
|
||||
}
|
||||
|
||||
if($row_outgoing->projektarbeitstitel != '')
|
||||
{
|
||||
$projektarbeitszusatz = 'Thesis: "'.$row_outgoing->projektarbeitstitel.'"';
|
||||
}
|
||||
else
|
||||
$projektarbeitszusatz = '';
|
||||
|
||||
echo '<lv>
|
||||
<lehrform_kurzbz></lehrform_kurzbz>
|
||||
<benotungsdatum>'.$benotungsdatum_outgoing.'</benotungsdatum>
|
||||
@@ -914,7 +910,7 @@ if (isset($_REQUEST["xmlformat"]) && $_REQUEST["xmlformat"] == "xml")
|
||||
<kurzbz>'.$lehrform_kurzbz_outgoing.'</kurzbz>
|
||||
<stsem></stsem>
|
||||
<bezeichnung><![CDATA[]]></bezeichnung>
|
||||
<bezeichnung_englisch><![CDATA[International Semester Abroad: '.$datum_von.'-'.$datum_bis.', at '.$row_outgoing->ort.', '.$row_outgoing->universitaet.'. All credits earned during the International Semester Abroad (ISA) are fully credited for the '.$start.$auslandssemester_start.' semester at the UAS Technikum Wien.]]></bezeichnung_englisch>
|
||||
<bezeichnung_englisch><![CDATA[International Semester Abroad: '.$datum_von.'-'.$datum_bis.', at '.$row_outgoing->ort.', '.$row_outgoing->universitaet.'. All credits earned during the International Semester Abroad (ISA) are fully credited for the '.$start.$auslandssemester_start.' semester at the UAS Technikum Wien.'.$projektarbeitszusatz.']]></bezeichnung_englisch>
|
||||
<ects>'.$row_outgoing->ects.'</ects>
|
||||
<semesterstunden>'.$row_outgoing->semesterstunden.'</semesterstunden>
|
||||
<note>'.$note_outgoing.'</note>
|
||||
|
||||
+3
-2
@@ -73,7 +73,8 @@ else
|
||||
function draw_rdf($row)
|
||||
{
|
||||
global $rdf_url;
|
||||
|
||||
if($row->kontakttyp == 'hidden')
|
||||
return;
|
||||
echo '
|
||||
<RDF:li>
|
||||
<RDF:Description id="'.$row->kontakt_id.'" about="'.$rdf_url.'/'.$row->kontakt_id.'" >
|
||||
@@ -93,4 +94,4 @@ function draw_rdf($row)
|
||||
}
|
||||
?>
|
||||
</RDF:Seq>
|
||||
</RDF:RDF>
|
||||
</RDF:RDF>
|
||||
|
||||
@@ -49,6 +49,8 @@ if($kontakt->getKontakttyp())
|
||||
{
|
||||
foreach ($kontakt->result as $row)
|
||||
{
|
||||
if($row->kontakttyp == 'hidden')
|
||||
continue;
|
||||
echo '
|
||||
<RDF:li>
|
||||
<RDF:Description id="'.$row->kontakttyp.'" about="'.$rdf_url.'/'.$row->kontakttyp.'" >
|
||||
@@ -65,4 +67,4 @@ else
|
||||
}
|
||||
?>
|
||||
</RDF:Seq>
|
||||
</RDF:RDF>
|
||||
</RDF:RDF>
|
||||
|
||||
@@ -62,6 +62,18 @@ echo '<div>';
|
||||
require_once($dbupdStr);
|
||||
echo '</div>';
|
||||
|
||||
|
||||
// ******** phrasenupdate ************/
|
||||
echo '<H2>Phrasen-Updates!</H2>';
|
||||
|
||||
echo '<div>';
|
||||
echo 'phrasesupdate.php wird aufgerufen...';
|
||||
echo '</div>';
|
||||
echo '<div>';
|
||||
require_once('phrasesupdate.php');
|
||||
echo '</div>';
|
||||
|
||||
|
||||
// ******** Berechtigungen Prüfen ************/
|
||||
echo '<h2>Berechtigungen pruefen</h2>';
|
||||
$neue=false;
|
||||
|
||||
@@ -2247,6 +2247,34 @@ if($result = $db->db_query("SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE
|
||||
}
|
||||
}
|
||||
|
||||
// Berechtigungen fuer vilesci User erteilen auf system.tbl_log
|
||||
if($result = @$db->db_query("SELECT * FROM information_schema.role_table_grants WHERE table_name='tbl_log' AND table_schema='system' AND grantee='vilesci' AND privilege_type='DELETE'"))
|
||||
{
|
||||
if($db->db_num_rows($result)==0)
|
||||
{
|
||||
$qry = "GRANT DELETE ON system.tbl_log TO vilesci;";
|
||||
|
||||
if(!$db->db_query($qry))
|
||||
echo '<strong>Permission Log: '.$db->db_last_error().'</strong><br>';
|
||||
else
|
||||
echo 'Loeschrechte auf system.tbl_log für Vilesci User hinzugefügt';
|
||||
}
|
||||
}
|
||||
|
||||
// Delete-Berechtigungen fuer web User erteilen auf system.tbl_log
|
||||
if($result = @$db->db_query("SELECT * FROM information_schema.role_table_grants WHERE table_name='tbl_log' AND table_schema='system' AND grantee='web' AND privilege_type='DELETE'"))
|
||||
{
|
||||
if($db->db_num_rows($result)==0)
|
||||
{
|
||||
$qry = "GRANT DELETE ON system.tbl_log TO web;";
|
||||
|
||||
if(!$db->db_query($qry))
|
||||
echo '<strong>Permission Log: '.$db->db_last_error().'</strong><br>';
|
||||
else
|
||||
echo 'Delete-Rechte auf system.tbl_log für Web User hinzugefügt';
|
||||
}
|
||||
}
|
||||
|
||||
// *** Pruefung und hinzufuegen der neuen Attribute und Tabellen
|
||||
echo '<H2>Pruefe Tabellen und Attribute!</H2>';
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user