mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-21 17:02:19 +00:00
Merge after last Commit
This commit is contained in:
@@ -207,6 +207,7 @@ $config['fhc_acl'] = array
|
||||
'system.tbl_udf' => 'system/udf',
|
||||
'system.tbl_extensions' => 'system/extensions',
|
||||
'system.tbl_log' => 'basis/log',
|
||||
'system.tbl_person_lock' => 'system/personlock',
|
||||
'testtool.tbl_ablauf' => 'basis/ablauf',
|
||||
'testtool.tbl_antwort' => 'basis/antwort',
|
||||
'testtool.tbl_frage' => 'basis/frage',
|
||||
|
||||
@@ -55,7 +55,8 @@ $config['roles'] = array
|
||||
(
|
||||
'basis/adresse','basis/akte','basis/kontakt','basis/log','basis/nation','basis/notiz','basis/notizzuordnung',
|
||||
'basis/person','basis/prestudent','basis/prestudentstatus','basis/status','basis/zgv','basis/zgvmaster',
|
||||
'lehre/studienplan','system/filters','fs/dms','basis/message','basis/benutzerrolle', 'basis/sprache'
|
||||
'lehre/studienplan','system/filters','fs/dms','basis/message','basis/benutzerrolle', 'basis/sprache',
|
||||
'system/personlock','basis/benutzerfunktion','system/vorlagestudiengang'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
@@ -33,7 +33,7 @@ class ViewMessage extends CI_Controller
|
||||
// Load model MessageToken_model, not calling the authentication system
|
||||
$this->load->model('system/MessageToken_model', 'MessageTokenModel');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Using the MessageTokenModel instead of MessageLib to allow
|
||||
* viewing the message without prompting the login
|
||||
@@ -50,32 +50,37 @@ class ViewMessage extends CI_Controller
|
||||
if (is_array($msg->retval) && count($msg->retval) > 0)
|
||||
{
|
||||
$setReadMessageStatusByToken = $this->MessageTokenModel->setReadMessageStatusByToken($token);
|
||||
|
||||
|
||||
if (isError($setReadMessageStatusByToken))
|
||||
{
|
||||
show_error($msg->$setReadMessageStatusByToken);
|
||||
}
|
||||
|
||||
|
||||
$sender_id = $msg->retval[0]->sender_id;
|
||||
$receiver_id = $msg->retval[0]->receiver_id;
|
||||
$sender = $this->MessageTokenModel->getSenderData($sender_id);
|
||||
|
||||
|
||||
// To decide how to change the redirection
|
||||
$isEmployee = $this->MessageTokenModel->isEmployee($receiver_id);
|
||||
if (!is_bool($isEmployee) && isError($isEmployee))
|
||||
{
|
||||
show_error($isEmployee);
|
||||
}
|
||||
|
||||
|
||||
if($this->config->item('redirect_view_message_url') != '')
|
||||
$href = APP_ROOT . $this->config->item('redirect_view_message_url') . $token;
|
||||
else
|
||||
$href = '';
|
||||
|
||||
$data = array (
|
||||
'sender_id' => $sender_id,
|
||||
'sender' => $sender->retval[0],
|
||||
'message' => $msg->retval[0],
|
||||
'isEmployee' => $isEmployee,
|
||||
'href' => APP_ROOT . $this->config->item('redirect_view_message_url') . $token
|
||||
'href' => $href
|
||||
);
|
||||
|
||||
|
||||
$this->load->view('system/messageHTML.php', $data);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,412 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Filters extends VileSci_Controller
|
||||
{
|
||||
const SESSION_NAME = 'FILTER';
|
||||
|
||||
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';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
// Load session library
|
||||
$this->load->library('session');
|
||||
|
||||
$this->load->model('system/Filters_model', 'FiltersModel');
|
||||
$this->load->model('person/Benutzer_model', 'BenutzerModel');
|
||||
}
|
||||
|
||||
public function tableDataset()
|
||||
{
|
||||
$json = new stdClass();
|
||||
|
||||
$json->selectedFields = $_SESSION[self::SESSION_NAME]['selectedFields'];
|
||||
$json->columnsAliases = $_SESSION[self::SESSION_NAME]['columnsAliases'];
|
||||
$json->additionalColumns = $_SESSION[self::SESSION_NAME]['additionalColumns'];
|
||||
$json->checkboxes = $_SESSION[self::SESSION_NAME]['checkboxes'];
|
||||
$json->dataset = $_SESSION[self::SESSION_NAME]['dataset'];
|
||||
|
||||
$this->output->set_content_type('application/json')->set_output(json_encode($json));
|
||||
}
|
||||
|
||||
public function selectFields()
|
||||
{
|
||||
$json = new stdClass();
|
||||
|
||||
$json->allSelectedFields = $_SESSION[self::SESSION_NAME]['allSelectedFields'];
|
||||
$json->allColumnsAliases = $_SESSION[self::SESSION_NAME]['allColumnsAliases'];
|
||||
|
||||
$json->selectedFields = $_SESSION[self::SESSION_NAME]['selectedFields'];
|
||||
$json->columnsAliases = $_SESSION[self::SESSION_NAME]['columnsAliases'];
|
||||
|
||||
$this->output->set_content_type('application/json')->set_output(json_encode($json));
|
||||
}
|
||||
|
||||
public function selectFilters()
|
||||
{
|
||||
$json = new stdClass();
|
||||
|
||||
$json->allSelectedFields = $_SESSION[self::SESSION_NAME]['allSelectedFields'];
|
||||
$json->allColumnsAliases = $_SESSION[self::SESSION_NAME]['allColumnsAliases'];
|
||||
|
||||
$json->selectedFilters = $_SESSION[self::SESSION_NAME]['selectedFilters'];
|
||||
$json->selectedFiltersAliases = array();
|
||||
$json->selectedFiltersMetaData = array();
|
||||
|
||||
$json->selectedFiltersActiveFilters = array();
|
||||
$json->selectedFiltersActiveFiltersOperation = array();
|
||||
$json->selectedFiltersActiveFiltersOption = array();
|
||||
|
||||
$metaData = $_SESSION[self::SESSION_NAME]['metaData'];
|
||||
$activeFilters = $_SESSION[self::SESSION_NAME]['activeFilters'];
|
||||
$activeFiltersOperation = $_SESSION[self::SESSION_NAME]['activeFiltersOperation'];
|
||||
$activeFiltersOption = $_SESSION[self::SESSION_NAME]['activeFiltersOption'];
|
||||
|
||||
for ($i = 0; $i < count($json->selectedFilters); $i++)
|
||||
{
|
||||
$pos = array_search($json->selectedFilters[$i], $json->allSelectedFields);
|
||||
|
||||
if ($pos !== false)
|
||||
{
|
||||
$json->selectedFiltersAliases[] = $json->selectedFilters[$i];
|
||||
if ($json->allColumnsAliases != null && is_array($json->allColumnsAliases))
|
||||
{
|
||||
$json->selectedFiltersAliases[] = $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->output->set_content_type('application/json')->set_output(json_encode('Tutto bene!!!'));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private function _saveFilter($customFilterDescription)
|
||||
{
|
||||
$objToBeSaved = new stdClass();
|
||||
|
||||
$filterSessionArray = $this->session->userdata(self::SESSION_NAME);
|
||||
|
||||
$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]['app'],
|
||||
'dataset_name' => $_SESSION[self::SESSION_NAME]['datasetName'],
|
||||
'description' => $descPGArray,
|
||||
'person_id' => $personId
|
||||
));
|
||||
|
||||
if (hasData($result))
|
||||
{
|
||||
$this->FiltersModel->update(
|
||||
array(
|
||||
'app' => $_SESSION[self::SESSION_NAME]['app'],
|
||||
'dataset_name' => $_SESSION[self::SESSION_NAME]['datasetName'],
|
||||
'description' => $descPGArray,
|
||||
'person_id' => $personId
|
||||
),
|
||||
array(
|
||||
'filter' => json_encode($objToBeSaved)
|
||||
)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->FiltersModel->insert(array(
|
||||
'app' => $_SESSION[self::SESSION_NAME]['app'],
|
||||
'dataset_name' => $_SESSION[self::SESSION_NAME]['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');
|
||||
|
||||
if (is_numeric($filter_id))
|
||||
{
|
||||
$this->FiltersModel->deleteCustomFilter($filter_id);
|
||||
|
||||
$this->output->set_content_type('application/json')->set_output(json_encode('Tutto bene!!!'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function removeSelectedFields()
|
||||
{
|
||||
$fieldName = $this->input->post('fieldName');
|
||||
|
||||
$allSelectedFields = $_SESSION[self::SESSION_NAME]['allSelectedFields'];
|
||||
$allColumnsAliases = $_SESSION[self::SESSION_NAME]['allColumnsAliases'];
|
||||
|
||||
$selectedFields = $_SESSION[self::SESSION_NAME]['selectedFields'];
|
||||
$columnsAliases = $_SESSION[self::SESSION_NAME]['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]['selectedFields'] = $selectedFields;
|
||||
$_SESSION[self::SESSION_NAME]['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');
|
||||
|
||||
$selectedFilters = $_SESSION[self::SESSION_NAME]['selectedFilters'];
|
||||
$selectedFiltersActiveFilters = $_SESSION[self::SESSION_NAME]['activeFilters'];
|
||||
$selectedFiltersActiveFiltersOperation = $_SESSION[self::SESSION_NAME]['activeFiltersOperation'];
|
||||
$selectedFiltersActiveFiltersOption = $_SESSION[self::SESSION_NAME]['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]['selectedFilters'] = $selectedFilters;
|
||||
$_SESSION[self::SESSION_NAME]['activeFilters'] = $selectedFiltersActiveFilters;
|
||||
$_SESSION[self::SESSION_NAME]['activeFiltersOperation'] = $selectedFiltersActiveFiltersOperation;
|
||||
$_SESSION[self::SESSION_NAME]['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');
|
||||
|
||||
$allSelectedFields = $_SESSION[self::SESSION_NAME]['allSelectedFields'];
|
||||
$allColumnsAliases = $_SESSION[self::SESSION_NAME]['allColumnsAliases'];
|
||||
|
||||
$selectedFields = $_SESSION[self::SESSION_NAME]['selectedFields'];
|
||||
$columnsAliases = $_SESSION[self::SESSION_NAME]['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]['selectedFields'] = $selectedFields;
|
||||
$_SESSION[self::SESSION_NAME]['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');
|
||||
|
||||
$selectedFilters = $_SESSION[self::SESSION_NAME]['selectedFilters'];
|
||||
$selectedFiltersActiveFilters = $_SESSION[self::SESSION_NAME]['activeFilters'];
|
||||
$selectedFiltersActiveFiltersOperation = $_SESSION[self::SESSION_NAME]['activeFiltersOperation'];
|
||||
$selectedFiltersActiveFiltersOption = $_SESSION[self::SESSION_NAME]['activeFiltersOption'];
|
||||
|
||||
if (!in_array($fieldName, $selectedFilters))
|
||||
{
|
||||
array_push($selectedFilters, $fieldName);
|
||||
$selectedFiltersActiveFilters[$fieldName] = "";
|
||||
$selectedFiltersActiveFiltersOperation[$fieldName] = "";
|
||||
$selectedFiltersActiveFiltersOption[$fieldName] = "";
|
||||
}
|
||||
|
||||
$_SESSION[self::SESSION_NAME]['selectedFilters'] = $selectedFilters;
|
||||
$_SESSION[self::SESSION_NAME]['activeFilters'] = $selectedFiltersActiveFilters;
|
||||
$_SESSION[self::SESSION_NAME]['activeFiltersOperation'] = $selectedFiltersActiveFiltersOperation;
|
||||
$_SESSION[self::SESSION_NAME]['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');
|
||||
|
||||
$activeFilters = array_combine($fieldNames, $filterOperationValues);
|
||||
$activeFiltersOperation = array_combine($fieldNames, $filterOperations);
|
||||
$activeFiltersOption = array_combine($fieldNames, $filterOptions);
|
||||
|
||||
$_SESSION[self::SESSION_NAME]['activeFilters'] = $activeFilters;
|
||||
$_SESSION[self::SESSION_NAME]['activeFiltersOperation'] = $activeFiltersOperation;
|
||||
$_SESSION[self::SESSION_NAME]['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));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function rowNumber()
|
||||
{
|
||||
$json = new stdClass();
|
||||
|
||||
$dataset = $_SESSION[self::SESSION_NAME]['dataset'];
|
||||
|
||||
if (is_array($dataset))
|
||||
{
|
||||
$json->rowNumber = count($dataset);
|
||||
}
|
||||
|
||||
$this->output->set_content_type('application/json')->set_output(json_encode($json));
|
||||
}
|
||||
}
|
||||
@@ -10,19 +10,19 @@ class Messages extends VileSci_Controller
|
||||
*
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
// Loads the message library
|
||||
$this->load->library('MessageLib');
|
||||
// Loads the message library
|
||||
$this->load->library('MessageLib');
|
||||
|
||||
// Loads the widget library
|
||||
// Loads the widget library
|
||||
$this->load->library('WidgetLib');
|
||||
|
||||
$this->load->model('person/Person_model', 'PersonModel');
|
||||
|
||||
$this->_setAuthUID(); // sets property uid
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* write
|
||||
|
||||
@@ -64,6 +64,7 @@ class InfoCenter extends VileSci_Controller
|
||||
$this->load->model('person/person_model', 'PersonModel');
|
||||
$this->load->model('system/message_model', 'MessageModel');
|
||||
$this->load->model('system/filters_model', 'FiltersModel');
|
||||
$this->load->model('system/personLock_model', 'PersonLockModel');
|
||||
|
||||
// Loads libraries
|
||||
$this->load->library('DmsLib');
|
||||
@@ -110,10 +111,20 @@ class InfoCenter extends VileSci_Controller
|
||||
if (!is_numeric($person_id))
|
||||
show_error('person id is not numeric!');
|
||||
|
||||
$persondata = $this->_loadPersonData($person_id);
|
||||
if (!isset($persondata))
|
||||
$personexists = $this->PersonModel->load($person_id);
|
||||
if(isError($personexists))
|
||||
show_error($personexists->retval);
|
||||
|
||||
if (empty($personexists->retval[0]))
|
||||
show_error('person does not exist!');
|
||||
|
||||
//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(
|
||||
@@ -129,6 +140,20 @@ class InfoCenter extends VileSci_Controller
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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))
|
||||
show_error($result->retval);
|
||||
|
||||
redirect(self::URL_PREFIX);
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves if a document has been formal geprueft. saves current timestamp if checked as geprueft, or null if not.
|
||||
*/
|
||||
@@ -169,6 +194,26 @@ class InfoCenter extends VileSci_Controller
|
||||
redirect(self::URL_PREFIX.'/showDetails/'.$person_id.'#DokPruef');
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets prestudent that was last modified in json format, for ZGV übernehmen
|
||||
* @param $person_id
|
||||
*/
|
||||
public function getLastPrestudentWithZgvJson($person_id)
|
||||
{
|
||||
$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));
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves a zgv for a prestudent. includes Ort, Datum, Nation for bachelor and master.
|
||||
* @param $prestudent_id
|
||||
@@ -200,7 +245,8 @@ class InfoCenter extends VileSci_Controller
|
||||
'zgvmas_code' => $zgvmas_code,
|
||||
'zgvmaort' => $zgvmaort,
|
||||
'zgvmadatum' => $zgvmadatum,
|
||||
'zgvmanation' => $zgvmanation_code
|
||||
'zgvmanation' => $zgvmanation_code,
|
||||
'updateamum' => date('Y-m-d H:i:s')
|
||||
)
|
||||
);
|
||||
|
||||
@@ -224,7 +270,6 @@ class InfoCenter extends VileSci_Controller
|
||||
*/
|
||||
public function saveAbsage($prestudent_id)
|
||||
{
|
||||
//TODO email messaging
|
||||
$statusgrund = $this->input->post('statusgrund');
|
||||
|
||||
$lastStatus = $this->PrestudentstatusModel->getLastStatus($prestudent_id);
|
||||
@@ -235,7 +280,7 @@ class InfoCenter extends VileSci_Controller
|
||||
}
|
||||
|
||||
//check if still Interessent and not freigegeben yet
|
||||
if($lastStatus->retval[0]->status_kurzbz === 'Interessent' && !isset($lastStatus->retval[0]->bestaetigtam))
|
||||
if ($lastStatus->retval[0]->status_kurzbz === 'Interessent' && !isset($lastStatus->retval[0]->bestaetigtam))
|
||||
{
|
||||
$result = $this->PrestudentstatusModel->insert(
|
||||
array(
|
||||
@@ -288,7 +333,7 @@ class InfoCenter extends VileSci_Controller
|
||||
$lastStatus = $lastStatus->retval[0];
|
||||
|
||||
//check if still Interessent and not freigegeben yet
|
||||
if($lastStatus->status_kurzbz === 'Interessent' && !isset($lastStatus->bestaetigtam))
|
||||
if ($lastStatus->status_kurzbz === 'Interessent' && !isset($lastStatus->bestaetigtam))
|
||||
{
|
||||
$result = $this->PrestudentstatusModel->update(
|
||||
array(
|
||||
@@ -310,6 +355,8 @@ class InfoCenter extends VileSci_Controller
|
||||
show_error($result->retval);
|
||||
}
|
||||
|
||||
$this->_sendFreigabeMail($prestudent_id);
|
||||
|
||||
$logdata = $this->_getPersonAndStudiengangFromPrestudent($prestudent_id);
|
||||
|
||||
$this->_log($logdata['person_id'], 'freigegeben', array($prestudent_id, $logdata['studiengang_kurzbz']));
|
||||
@@ -369,21 +416,6 @@ class InfoCenter extends VileSci_Controller
|
||||
->_display();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function deleteCustomFilter()
|
||||
{
|
||||
$filter_id = $this->input->get('filter_id');
|
||||
|
||||
if (is_numeric($filter_id))
|
||||
{
|
||||
$this->FiltersModel->deleteCustomFilter($filter_id);
|
||||
|
||||
redirect(self::URL_PREFIX);
|
||||
}
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
@@ -504,8 +536,9 @@ class InfoCenter extends VileSci_Controller
|
||||
$tofill['children'][] = array(
|
||||
'link' => sprintf($toPrint, base_url('index.ci.php/system/infocenter/InfoCenter?filter_id'), $filterId),
|
||||
'description' => $description,
|
||||
'subscriptLink' => sprintf($toPrint, base_url('index.ci.php/system/infocenter/InfoCenter/deleteCustomFilter?filter_id'), $filterId),
|
||||
'subscriptDescription' => 'Remove'
|
||||
'subscriptDescription' => 'Remove',
|
||||
'subscriptLinkId' => 'removeFilterById',
|
||||
'subscriptLinkValue' => $filterId
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -517,6 +550,25 @@ class InfoCenter extends VileSci_Controller
|
||||
*/
|
||||
private function _loadPersonData($person_id)
|
||||
{
|
||||
$locked = $this->PersonLockModel->checkIfLocked($person_id, self::APP);
|
||||
|
||||
if (isError($locked))
|
||||
{
|
||||
show_error($locked->retval);
|
||||
}
|
||||
|
||||
$lockedby = null;
|
||||
|
||||
//mark red if locked by other user
|
||||
$lockedbyother = false;
|
||||
|
||||
if (isset($locked->retval[0]->uid))
|
||||
{
|
||||
$lockedby = $locked->retval[0]->uid;
|
||||
if ($lockedby !== $this->uid)
|
||||
$lockedbyother = true;
|
||||
}
|
||||
|
||||
$stammdaten = $this->PersonModel->getPersonStammdaten($person_id, true);
|
||||
|
||||
if (isError($stammdaten))
|
||||
@@ -567,6 +619,8 @@ class InfoCenter extends VileSci_Controller
|
||||
$messagelink = base_url('/index.ci.php/system/Messages/write/'.$user_person->retval[0]->person_id);
|
||||
|
||||
$data = array (
|
||||
'lockedby' => $lockedby,
|
||||
'lockedbyother' => $lockedbyother,
|
||||
'stammdaten' => $stammdaten->retval,
|
||||
'dokumente' => $dokumente->retval,
|
||||
'dokumente_nachgereicht' => $dokumente_nachgereicht->retval,
|
||||
@@ -606,7 +660,7 @@ class InfoCenter extends VileSci_Controller
|
||||
|
||||
$zgvpruefung = $prestudent->retval[0];
|
||||
|
||||
if(isset($zgvpruefung->prestudentstatus))
|
||||
if (isset($zgvpruefung->prestudentstatus))
|
||||
{
|
||||
$position = strpos($zgvpruefung->prestudentstatus->anmerkung, 'Alt:');
|
||||
|
||||
@@ -619,15 +673,18 @@ class InfoCenter extends VileSci_Controller
|
||||
$zgvpruefungen[] = $zgvpruefung;
|
||||
}
|
||||
|
||||
// Interessenten come first
|
||||
usort($zgvpruefungen, function ($a, $b)
|
||||
{
|
||||
// Interessenten come first, otherwise by bewerbungsdatum desc, then by prestudent_id desc
|
||||
usort($zgvpruefungen, function ($a, $b) {
|
||||
$bewdatesort = strcmp($b->prestudentstatus->bewerbung_abgeschicktamum, $a->prestudentstatus->bewerbung_abgeschicktamum);
|
||||
$defaultsort = $bewdatesort === 0 ? (int)$b->prestudent_id - (int)$a->prestudent_id : $bewdatesort;
|
||||
if (!isset($a->prestudentstatus->status_kurzbz) || !isset($b->prestudentstatus->status_kurzbz))
|
||||
return 0;
|
||||
return $defaultsort;
|
||||
elseif ($a->prestudentstatus->status_kurzbz === 'Interessent' && $b->prestudentstatus->status_kurzbz === 'Interessent')
|
||||
{
|
||||
//infoonly Interessenten come after new Interessenten
|
||||
if ($a->infoonly)
|
||||
if ($a->infoonly === $b->infoonly)
|
||||
return $defaultsort;
|
||||
elseif ($a->infoonly)
|
||||
return 1;
|
||||
elseif ($b->infoonly)
|
||||
return -1;
|
||||
@@ -637,7 +694,7 @@ class InfoCenter extends VileSci_Controller
|
||||
elseif ($b->prestudentstatus->status_kurzbz === 'Interessent')
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
return $defaultsort;
|
||||
});
|
||||
|
||||
$statusgruende = $this->StatusgrundModel->loadWhere(array('status_kurzbz' => 'Abgewiesener'))->retval;
|
||||
@@ -708,4 +765,86 @@ class InfoCenter extends VileSci_Controller
|
||||
$this->uid
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends infomail with prestudent and person data when Prestudent is freigegeben
|
||||
* @param $prestudent_id
|
||||
*/
|
||||
private function _sendFreigabeMail($prestudent_id)
|
||||
{
|
||||
//get data
|
||||
$prestudent = $this->PrestudentModel->getPrestudentWithZgv($prestudent_id)->retval[0];
|
||||
$prestudentstatus = $prestudent->prestudentstatus;
|
||||
$person_id = $prestudent->person_id;
|
||||
$person = $this->PersonModel->getPersonStammdaten($person_id, true)->retval;
|
||||
|
||||
//fill mail variables
|
||||
$interessentbez = $person->geschlecht == 'm' ? 'Ein Interessent' : 'Eine Interessentin';
|
||||
$sprache = $prestudentstatus->sprachedetails->bezeichnung[0];
|
||||
$orgform = $prestudentstatus->orgform != '' ? ' ('.$prestudentstatus->orgform.')' : '';
|
||||
$geschlecht = $person->geschlecht == 'm' ? 'männlich' : 'weiblich';
|
||||
$geburtsdatum = date('d.m.Y', strtotime($person->gebdatum));
|
||||
|
||||
$notizenBewerbung = $this->NotizModel->getNotizByTitel($person_id, 'Anmerkung zur Bewerbung')->retval;
|
||||
|
||||
$notizentext = '';
|
||||
$lastElement = end($notizenBewerbung);
|
||||
foreach ($notizenBewerbung as $notiz)
|
||||
{
|
||||
$notizentext .= $notiz->text;
|
||||
if ($notiz != $lastElement)
|
||||
$notizentext .= ' | ';
|
||||
}
|
||||
|
||||
$mailadresse = '';
|
||||
foreach ($person->kontakte as $kontakt)
|
||||
{
|
||||
if ($kontakt->kontakttyp === 'email')
|
||||
{
|
||||
$mailadresse = $kontakt->kontakt;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$data = array
|
||||
(
|
||||
'interessentbez' => $interessentbez,
|
||||
'studiengangbez' => $prestudent->studiengangbezeichnung,
|
||||
'studiengangtypbez' => $prestudent->studiengangtyp_bez,
|
||||
'orgform' => $orgform,
|
||||
'studiensemester' => $prestudentstatus->studiensemester_kurzbz,
|
||||
'sprache' => $sprache,
|
||||
'geschlecht' => $geschlecht,
|
||||
'vorname' => $person->vorname,
|
||||
'nachname' => $person->nachname,
|
||||
'gebdatum' => $geburtsdatum,
|
||||
'mailadresse' => $mailadresse,
|
||||
'prestudentid' => $prestudent_id,
|
||||
'notizentext' => $notizentext
|
||||
);
|
||||
|
||||
$this->load->library('parser');
|
||||
$this->load->library('MailLib');
|
||||
$this->load->library('LogLib');
|
||||
|
||||
//parse freigabe html email template, wordwrap wraps text so no display errors
|
||||
$email = wordwrap($this->parser->parse('templates/mailtemplates/interessentFreigabe', $data, true), 70);
|
||||
|
||||
$subject = ($person->geschlecht == 'm' ? 'Interessent ' : 'Interessentin ').$person->vorname.' '.$person->nachname.' freigegeben';
|
||||
|
||||
$receiver = $prestudent->studiengangmail;
|
||||
|
||||
if (!empty($receiver))
|
||||
{
|
||||
//Freigabeinformationmail sent from default system mail to studiengang mail(s)
|
||||
$sent = $this->maillib->send('', $receiver, $subject, $email);
|
||||
|
||||
if (!$sent)
|
||||
$this->loglib->logError('Error when sending Freigabe mail');
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->loglib->logError('Studiengang has no mail for sending Freigabe mail');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -540,6 +540,21 @@ class DB_Model extends FHC_Model
|
||||
return $this->db->escape($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* This method call the method escape_like_str from class CI_DB_driver, therefore:
|
||||
* this method should be used when strings are to be used in LIKE conditions so that LIKE wildcards (‘%’, ‘_’)
|
||||
* in the string are also properly escaped.
|
||||
* NOTE: The escape_like_str() method uses ‘!’ (exclamation mark) to escape special characters for LIKE conditions.
|
||||
* Because this method escapes partial strings that you would wrap in quotes yourself, it cannot automatically
|
||||
* add the ESCAPE '!' condition for you, and so you’ll have to manually do that.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function escapeLike($value)
|
||||
{
|
||||
return $this->db->escape_like_str($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert PG-Boolean to PHP-Boolean
|
||||
*
|
||||
|
||||
@@ -55,7 +55,7 @@ class LogLib
|
||||
$function = $backtrace_arr[$functionIndex]['function'];
|
||||
}
|
||||
|
||||
if (isset($backtrace_arr[$lineIndex]['line']) && $backgrace_arr[$lineIndex]['line'] != '')
|
||||
if (isset($backtrace_arr[$lineIndex]['line']) && $backtrace_arr[$lineIndex]['line'] != '')
|
||||
{
|
||||
$line = $backtrace_arr[$lineIndex]['line'];
|
||||
}
|
||||
|
||||
@@ -58,6 +58,14 @@ class MailLib
|
||||
$alias = $this->alias_from_system;
|
||||
}
|
||||
}
|
||||
if (defined('MAIL_FROM') && MAIL_FROM != '')
|
||||
{
|
||||
$from = MAIL_FROM;
|
||||
if (is_null($alias) || $alias == '')
|
||||
{
|
||||
$alias = $this->alias_from_system;
|
||||
}
|
||||
}
|
||||
|
||||
$this->ci->email->from($from, $alias);
|
||||
|
||||
@@ -65,12 +73,14 @@ class MailLib
|
||||
$recipient = $to;
|
||||
$recipientCC = $cc;
|
||||
$recipientBCC = $bcc;
|
||||
if ($this->validateEmailAddress(MAIL_DEBUG))
|
||||
if (defined('MAIL_DEBUG') && MAIL_DEBUG != '')
|
||||
{
|
||||
// if is it valid use it!!!
|
||||
$recipient = MAIL_DEBUG;
|
||||
$recipientCC = MAIL_DEBUG;
|
||||
$recipientBCC = MAIL_DEBUG;
|
||||
if ($recipientCC != '')
|
||||
$recipientCC = MAIL_DEBUG;
|
||||
if ($recipientBCC != '')
|
||||
$recipientBCC = MAIL_DEBUG;
|
||||
}
|
||||
|
||||
$this->ci->email->to($recipient);
|
||||
|
||||
@@ -15,7 +15,7 @@ class MessageLib
|
||||
public function __construct()
|
||||
{
|
||||
// Get code igniter instance
|
||||
$this->ci =& get_instance();
|
||||
$this->ci =& get_instance();
|
||||
|
||||
// Loads message configuration
|
||||
$this->ci->config->load('message');
|
||||
@@ -41,70 +41,70 @@ class MessageLib
|
||||
$this->ci->load->helper('message');
|
||||
|
||||
// Loads phrases
|
||||
$this->ci->lang->load('message');
|
||||
}
|
||||
$this->ci->lang->load('message');
|
||||
}
|
||||
|
||||
/**
|
||||
* getMessage() - returns the specified received message for a specified person
|
||||
*/
|
||||
public function getMessage($msg_id, $person_id)
|
||||
{
|
||||
if (empty($msg_id))
|
||||
return $this->_error('', MSG_ERR_INVALID_MSG_ID);
|
||||
/**
|
||||
* getMessage() - returns the specified received message for a specified person
|
||||
*/
|
||||
public function getMessage($msg_id, $person_id)
|
||||
{
|
||||
if (empty($msg_id))
|
||||
return $this->_error('', MSG_ERR_INVALID_MSG_ID);
|
||||
if (empty($person_id))
|
||||
return $this->_error('', MSG_ERR_INVALID_RECIPIENTS);
|
||||
return $this->_error('', MSG_ERR_INVALID_RECIPIENTS);
|
||||
|
||||
$msg = $this->ci->RecipientModel->getMessage($msg_id, $person_id);
|
||||
|
||||
return $msg;
|
||||
}
|
||||
return $msg;
|
||||
}
|
||||
|
||||
/**
|
||||
* getMessagesByUID() - will return all messages, including the latest status for specified user. It don´t returns Attachments.
|
||||
*/
|
||||
public function getMessagesByUID($uid, $oe_kurzbz = null, $all = false)
|
||||
{
|
||||
if (empty($uid))
|
||||
return $this->_error('', MSG_ERR_INVALID_MSG_ID);
|
||||
* getMessagesByUID() - will return all messages, including the latest status for specified user. It don´t returns Attachments.
|
||||
*/
|
||||
public function getMessagesByUID($uid, $oe_kurzbz = null, $all = false)
|
||||
{
|
||||
if (empty($uid))
|
||||
return $this->_error('', MSG_ERR_INVALID_MSG_ID);
|
||||
|
||||
$msg = $this->ci->RecipientModel->getMessagesByUID($uid, $oe_kurzbz, $all);
|
||||
|
||||
return $msg;
|
||||
}
|
||||
return $msg;
|
||||
}
|
||||
|
||||
/**
|
||||
* getMessagesByPerson() - will return all messages, including the latest status for specified user. It don´t returns Attachments.
|
||||
*/
|
||||
public function getMessagesByPerson($person_id, $oe_kurzbz = null, $all = false)
|
||||
{
|
||||
if (empty($person_id))
|
||||
return $this->_error('', MSG_ERR_INVALID_MSG_ID);
|
||||
* getMessagesByPerson() - will return all messages, including the latest status for specified user. It don´t returns Attachments.
|
||||
*/
|
||||
public function getMessagesByPerson($person_id, $oe_kurzbz = null, $all = false)
|
||||
{
|
||||
if (empty($person_id))
|
||||
return $this->_error('', MSG_ERR_INVALID_MSG_ID);
|
||||
|
||||
$msg = $this->ci->RecipientModel->getMessagesByPerson($person_id, $oe_kurzbz, $all);
|
||||
|
||||
return $msg;
|
||||
}
|
||||
return $msg;
|
||||
}
|
||||
|
||||
/**
|
||||
* getSentMessagesByPerson() - Get all sent messages from a person identified by person_id
|
||||
*/
|
||||
public function getSentMessagesByPerson($person_id, $oe_kurzbz = null, $all = false)
|
||||
{
|
||||
if (empty($person_id))
|
||||
return $this->_error('', MSG_ERR_INVALID_MSG_ID);
|
||||
* getSentMessagesByPerson() - Get all sent messages from a person identified by person_id
|
||||
*/
|
||||
public function getSentMessagesByPerson($person_id, $oe_kurzbz = null, $all = false)
|
||||
{
|
||||
if (empty($person_id))
|
||||
return $this->_error('', MSG_ERR_INVALID_MSG_ID);
|
||||
|
||||
$msg = $this->ci->MessageModel->getMessagesByPerson($person_id, $oe_kurzbz, $all);
|
||||
|
||||
return $msg;
|
||||
}
|
||||
return $msg;
|
||||
}
|
||||
|
||||
/**
|
||||
* getMessageByToken
|
||||
*/
|
||||
public function getMessageByToken($token)
|
||||
{
|
||||
if (empty($token))
|
||||
return $this->_error('', MSG_ERR_INVALID_TOKEN);
|
||||
* getMessageByToken
|
||||
*/
|
||||
public function getMessageByToken($token)
|
||||
{
|
||||
if (empty($token))
|
||||
return $this->_error('', MSG_ERR_INVALID_TOKEN);
|
||||
|
||||
$result = $this->ci->RecipientModel->getMessageByToken($token);
|
||||
if (hasData($result))
|
||||
@@ -138,43 +138,43 @@ class MessageLib
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* getCountUnreadMessages
|
||||
*/
|
||||
public function getCountUnreadMessages($person_id, $oe_kurzbz = null)
|
||||
{
|
||||
if (!is_numeric($person_id))
|
||||
return $this->_error('', MSG_ERR_INVALID_RECIPIENTS);
|
||||
/**
|
||||
* getCountUnreadMessages
|
||||
*/
|
||||
public function getCountUnreadMessages($person_id, $oe_kurzbz = null)
|
||||
{
|
||||
if (!is_numeric($person_id))
|
||||
return $this->_error('', MSG_ERR_INVALID_RECIPIENTS);
|
||||
|
||||
$msg = $this->ci->RecipientModel->getCountUnreadMessages($person_id, $oe_kurzbz);
|
||||
|
||||
return $msg;
|
||||
}
|
||||
return $msg;
|
||||
}
|
||||
|
||||
/**
|
||||
* updateMessageStatus() - will change status on message for particular user
|
||||
/**
|
||||
* updateMessageStatus() - will change status on message for particular user
|
||||
* NOTE: it performs an insert, NOT an update
|
||||
*/
|
||||
public function updateMessageStatus($message_id, $person_id, $status)
|
||||
{
|
||||
if (empty($message_id))
|
||||
{
|
||||
return $this->_error('', MSG_ERR_INVALID_MSG_ID);
|
||||
}
|
||||
*/
|
||||
public function updateMessageStatus($message_id, $person_id, $status)
|
||||
{
|
||||
if (empty($message_id))
|
||||
{
|
||||
return $this->_error('', MSG_ERR_INVALID_MSG_ID);
|
||||
}
|
||||
|
||||
if (empty($person_id))
|
||||
{
|
||||
return $this->_error('', MSG_ERR_INVALID_USER_ID);
|
||||
}
|
||||
if (empty($person_id))
|
||||
{
|
||||
return $this->_error('', MSG_ERR_INVALID_USER_ID);
|
||||
}
|
||||
|
||||
// NOTE: Not use empty otherwise if status is 0 it returns an error
|
||||
if (!isset($status))
|
||||
{
|
||||
return $this->_error('', MSG_ERR_INVALID_STATUS_ID);
|
||||
}
|
||||
if (!isset($status))
|
||||
{
|
||||
return $this->_error('', MSG_ERR_INVALID_STATUS_ID);
|
||||
}
|
||||
|
||||
// Searches if the status is already present
|
||||
$result = $this->ci->MsgStatusModel->load(array($message_id, $person_id, $status));
|
||||
@@ -195,17 +195,17 @@ class MessageLib
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* sendMessage() - sends new internal message. This function will create a new thread
|
||||
*/
|
||||
public function sendMessage($sender_id, $receiver_id, $subject, $body, $priority = PRIORITY_NORMAL, $relationmessage_id = null, $oe_kurzbz = null, $multiPartMime = true)
|
||||
{
|
||||
if (!is_numeric($sender_id))
|
||||
{
|
||||
/**
|
||||
* sendMessage() - sends new internal message. This function will create a new thread
|
||||
*/
|
||||
public function sendMessage($sender_id, $receiver_id, $subject, $body, $priority = PRIORITY_NORMAL, $relationmessage_id = null, $oe_kurzbz = null, $multiPartMime = true)
|
||||
{
|
||||
if (!is_numeric($sender_id))
|
||||
{
|
||||
$sender_id = $this->ci->config->item('system_person_id');
|
||||
}
|
||||
}
|
||||
|
||||
$receivers = $this->_getReceivers($receiver_id, $oe_kurzbz);
|
||||
|
||||
@@ -270,17 +270,17 @@ class MessageLib
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* sendMessageVorlage() - sends new internal message using a template
|
||||
*/
|
||||
public function sendMessageVorlage($sender_id, $receiver_id, $vorlage_kurzbz, $oe_kurzbz, $data, $relationmessage_id = null, $orgform_kurzbz = null, $multiPartMime = true)
|
||||
{
|
||||
if (!is_numeric($sender_id))
|
||||
{
|
||||
* sendMessageVorlage() - sends new internal message using a template
|
||||
*/
|
||||
public function sendMessageVorlage($sender_id, $receiver_id, $vorlage_kurzbz, $oe_kurzbz, $data, $relationmessage_id = null, $orgform_kurzbz = null, $multiPartMime = true)
|
||||
{
|
||||
if (!is_numeric($sender_id))
|
||||
{
|
||||
$sender_id = $this->ci->config->item('system_person_id');
|
||||
}
|
||||
}
|
||||
|
||||
$receivers = $this->_getReceivers($receiver_id, $oe_kurzbz);
|
||||
|
||||
@@ -387,7 +387,7 @@ class MessageLib
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets all the messages from DB and sends them via email
|
||||
@@ -426,54 +426,90 @@ class MessageLib
|
||||
if ((!is_null($result->retval[$i]->receiver) && $result->retval[$i]->receiver != '')
|
||||
|| (!is_null($result->retval[$i]->employeecontact) && $result->retval[$i]->employeecontact != ''))
|
||||
{
|
||||
$href = $this->ci->config->item('message_server').$this->ci->config->item('message_html_view_url').$result->retval[0]->token;
|
||||
// Using a template for the html email body
|
||||
$body = $this->ci->parser->parse(
|
||||
'templates/mailHTML',
|
||||
array(
|
||||
'href' => $href,
|
||||
'subject' => $result->retval[0]->subject,
|
||||
'body' => $result->retval[0]->body
|
||||
),
|
||||
true
|
||||
);
|
||||
$href = $this->ci->config->item('message_server').$this->ci->config->item('message_html_view_url').$result->retval[$i]->token;
|
||||
|
||||
$vorlage = $this->ci->vorlagelib->loadVorlagetext('MessageMailHTML');
|
||||
|
||||
if(hasData($vorlage))
|
||||
{
|
||||
// Using a template for the html email body
|
||||
$body = $this->ci->parser->parse_string(
|
||||
$vorlage->retval[0]->text,
|
||||
array(
|
||||
'href' => $href,
|
||||
'subject' => $result->retval[$i]->subject,
|
||||
'body' => $result->retval[$i]->body
|
||||
),
|
||||
true
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Using a template for the html email body
|
||||
$body = $this->ci->parser->parse(
|
||||
'templates/mailHTML',
|
||||
array(
|
||||
'href' => $href,
|
||||
'subject' => $result->retval[$i]->subject,
|
||||
'body' => $result->retval[$i]->body
|
||||
),
|
||||
true
|
||||
);
|
||||
}
|
||||
if (is_null($body) || $body == '')
|
||||
{
|
||||
$this->ci->loglib->logError('Error while parsing the mail template');
|
||||
}
|
||||
|
||||
// Using a template for the plain text email body
|
||||
$altBody = $this->ci->parser->parse(
|
||||
'templates/mailTXT',
|
||||
array(
|
||||
'href' => $href,
|
||||
'subject' => $result->retval[0]->subject,
|
||||
'body' => $result->retval[0]->body
|
||||
),
|
||||
true
|
||||
);
|
||||
$vorlage = $this->ci->vorlagelib->loadVorlagetext('MessageMailTXT');
|
||||
if(hasData($vorlage))
|
||||
{
|
||||
// Using a template for the plain text email body
|
||||
$altBody = $this->ci->parser->parse_string(
|
||||
$vorlage->retval[0]->text,
|
||||
array(
|
||||
'href' => $href,
|
||||
'subject' => $result->retval[$i]->subject,
|
||||
'body' => $result->retval[$i]->body
|
||||
),
|
||||
true
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Using a template for the plain text email body
|
||||
$altBody = $this->ci->parser->parse(
|
||||
'templates/mailTXT',
|
||||
array(
|
||||
'href' => $href,
|
||||
'subject' => $result->retval[$i]->subject,
|
||||
'body' => $result->retval[$i]->body
|
||||
),
|
||||
true
|
||||
);
|
||||
}
|
||||
if (is_null($altBody) || $altBody == '')
|
||||
{
|
||||
$this->ci->loglib->logError('Error while parsing the mail template');
|
||||
}
|
||||
|
||||
// If the sender kontakt does not exist, then system-sender is used if empty
|
||||
// If the sender is not an employee, then system-sender is used if empty
|
||||
$sender = '';
|
||||
if (!is_null($result->retval[0]->sender) && $result->retval[0]->sender != '')
|
||||
if (!is_null($result->retval[0]->senderemployeecontact) && $result->retval[0]->senderemployeecontact != '')
|
||||
{
|
||||
$sender = $result->retval[0]->sender;
|
||||
$sender = $result->retval[0]->senderemployeecontact.'@'.DOMAIN;
|
||||
}
|
||||
|
||||
$receiverContanct = $result->retval[$i]->receiver;
|
||||
$receiverContact = $result->retval[$i]->receiver;
|
||||
if (!is_null($result->retval[$i]->employeecontact) && $result->retval[$i]->employeecontact != '')
|
||||
{
|
||||
$receiverContanct = $result->retval[$i]->employeecontact.'@'.DOMAIN;
|
||||
$receiverContact = $result->retval[$i]->employeecontact.'@'.DOMAIN;
|
||||
}
|
||||
|
||||
// Sending email
|
||||
$sent = $this->ci->maillib->send(
|
||||
$sender,
|
||||
$receiverContanct,
|
||||
$receiverContact,
|
||||
$result->retval[$i]->subject,
|
||||
$body,
|
||||
null,
|
||||
@@ -571,15 +607,32 @@ class MessageLib
|
||||
{
|
||||
// Using a template for the html email body
|
||||
$href = $this->ci->config->item('message_server').$this->ci->config->item('message_html_view_url').$result->retval[0]->token;
|
||||
$bodyMsg = $this->ci->parser->parse(
|
||||
'templates/mailHTML',
|
||||
array(
|
||||
'href' => $href,
|
||||
'subject' => $result->retval[0]->subject,
|
||||
'body' => $result->retval[0]->body
|
||||
),
|
||||
true
|
||||
);
|
||||
|
||||
$vorlage = $this->ci->vorlagelib->loadVorlagetext('MessageMailHTML');
|
||||
if(hasData($vorlage))
|
||||
{
|
||||
$bodyMsg = $this->ci->parser->parse_string(
|
||||
$vorlage->retval[0]->text,
|
||||
array(
|
||||
'href' => $href,
|
||||
'subject' => $result->retval[0]->subject,
|
||||
'body' => $result->retval[0]->body
|
||||
),
|
||||
true
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$bodyMsg = $this->ci->parser->parse(
|
||||
'templates/mailHTML',
|
||||
array(
|
||||
'href' => $href,
|
||||
'subject' => $result->retval[0]->subject,
|
||||
'body' => $result->retval[0]->body
|
||||
),
|
||||
true
|
||||
);
|
||||
}
|
||||
if (is_null($bodyMsg) || $bodyMsg == '')
|
||||
{
|
||||
// $body = $result->retval[0]->body;
|
||||
@@ -587,15 +640,31 @@ class MessageLib
|
||||
}
|
||||
|
||||
// Using a template for the plain text email body
|
||||
$altBody = $this->ci->parser->parse(
|
||||
'templates/mailTXT',
|
||||
array(
|
||||
'href' => $href,
|
||||
'subject' => $result->retval[0]->subject,
|
||||
'body' => $result->retval[0]->body
|
||||
),
|
||||
true
|
||||
);
|
||||
$vorlage = $this->ci->vorlagelib->loadVorlagetext('MessageMailTXT');
|
||||
if(hasData($vorlage))
|
||||
{
|
||||
$altBody = $this->ci->parser->parse_string(
|
||||
$vorlage->retval[0]->text,
|
||||
array(
|
||||
'href' => $href,
|
||||
'subject' => $result->retval[0]->subject,
|
||||
'body' => $result->retval[0]->body
|
||||
),
|
||||
true
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$altBody = $this->ci->parser->parse(
|
||||
'templates/mailTXT',
|
||||
array(
|
||||
'href' => $href,
|
||||
'subject' => $result->retval[0]->subject,
|
||||
'body' => $result->retval[0]->body
|
||||
),
|
||||
true
|
||||
);
|
||||
}
|
||||
if (is_null($altBody) || $altBody == '')
|
||||
{
|
||||
$this->ci->loglib->logError('Error while parsing the plain text mail template');
|
||||
@@ -606,23 +675,23 @@ class MessageLib
|
||||
$bodyMsg = $altBody = $body;
|
||||
}
|
||||
|
||||
// If the sender kontakt does not exist, then system-sender is used if empty
|
||||
// If the sender is not an employee, then system-sender is used if empty
|
||||
$sender = '';
|
||||
if (!is_null($result->retval[0]->sender) && $result->retval[0]->sender != '')
|
||||
if (!is_null($result->retval[0]->senderemployeecontact) && $result->retval[0]->senderemployeecontact != '')
|
||||
{
|
||||
$sender = $result->retval[0]->sender;
|
||||
$sender = $result->retval[0]->senderemployeecontact.'@'.DOMAIN;
|
||||
}
|
||||
|
||||
$receiverContanct = $result->retval[0]->receiver;
|
||||
$receiverContact = $result->retval[0]->receiver;
|
||||
if (!is_null($result->retval[0]->employeecontact) && $result->retval[0]->employeecontact != '')
|
||||
{
|
||||
$receiverContanct = $result->retval[0]->employeecontact.'@'.DOMAIN;
|
||||
$receiverContact = $result->retval[0]->employeecontact.'@'.DOMAIN;
|
||||
}
|
||||
|
||||
// Sending email
|
||||
$sent = $this->ci->maillib->send(
|
||||
$sender,
|
||||
$receiverContanct,
|
||||
$receiverContact,
|
||||
is_null($subject) ? $result->retval[0]->subject : $subject, // if parameter subject is not null, use it!
|
||||
$bodyMsg,
|
||||
null,
|
||||
@@ -689,8 +758,8 @@ class MessageLib
|
||||
return $sent;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// Private methods
|
||||
// ------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
/**
|
||||
* Update the table tbl_msg_recipient
|
||||
@@ -736,29 +805,29 @@ class MessageLib
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the receivers id that are enabled to read messages for that oe_kurzbz
|
||||
*/
|
||||
private function _getReceiversByOekurzbz($oe_kurzbz)
|
||||
{
|
||||
* Gets the receivers id that are enabled to read messages for that oe_kurzbz
|
||||
*/
|
||||
private function _getReceiversByOekurzbz($oe_kurzbz)
|
||||
{
|
||||
// Load Benutzerfunktion_model
|
||||
$this->ci->load->model('person/Benutzerfunktion_model', 'BenutzerfunktionModel');
|
||||
// Join with table public.tbl_benutzer on field uid
|
||||
$this->ci->BenutzerfunktionModel->addJoin('public.tbl_benutzer', 'uid');
|
||||
// Get all the valid receivers id using the oe_kurzbz
|
||||
$receivers = $this->ci->BenutzerfunktionModel->loadWhere(
|
||||
'oe_kurzbz = \''.$oe_kurzbz.'\''.
|
||||
' AND funktion_kurzbz = \''.$this->ci->config->item('assistent_function').'\''.
|
||||
'oe_kurzbz = '.$this->ci->db->escape($oe_kurzbz).
|
||||
' AND funktion_kurzbz = '.$this->ci->db->escape($this->ci->config->item('assistent_function')).
|
||||
' AND (NOW() BETWEEN COALESCE(datum_von, NOW()) AND COALESCE(datum_bis, NOW()))'
|
||||
);
|
||||
|
||||
return $receivers;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the receivers id
|
||||
*/
|
||||
private function _getReceivers($receiver_id, $oe_kurzbz = null)
|
||||
{
|
||||
/**
|
||||
* Gets the receivers id
|
||||
*/
|
||||
private function _getReceivers($receiver_id, $oe_kurzbz = null)
|
||||
{
|
||||
$receivers = null;
|
||||
|
||||
// If no receiver_id is given...
|
||||
@@ -782,13 +851,13 @@ class MessageLib
|
||||
}
|
||||
|
||||
return $receivers;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the given receiver id is a valid person
|
||||
*/
|
||||
private function _checkReceiverId($receiver_id)
|
||||
{
|
||||
/**
|
||||
* Checks if the given receiver id is a valid person
|
||||
*/
|
||||
private function _checkReceiverId($receiver_id)
|
||||
{
|
||||
// Load Person_model
|
||||
$this->ci->load->model('person/Person_model', 'PersonModel');
|
||||
$result = $this->ci->PersonModel->load($receiver_id);
|
||||
@@ -798,13 +867,13 @@ class MessageLib
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Save a message in DB
|
||||
**/
|
||||
private function _saveMessage($sender_id, $receiver_id, $subject, $body, $relationmessage_id, $oe_kurzbz)
|
||||
{
|
||||
/**
|
||||
* Save a message in DB
|
||||
**/
|
||||
private function _saveMessage($sender_id, $receiver_id, $subject, $body, $relationmessage_id, $oe_kurzbz)
|
||||
{
|
||||
// Starts db transaction
|
||||
$this->ci->db->trans_start(false);
|
||||
|
||||
@@ -854,27 +923,27 @@ class MessageLib
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrapper for function error
|
||||
*/
|
||||
private function _error($retval = '', $code = null)
|
||||
{
|
||||
/**
|
||||
* Wrapper for function error
|
||||
*/
|
||||
private function _error($retval = '', $code = null)
|
||||
{
|
||||
return error($retval, $code, MessageLib::MSG_INDX_PREFIX);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrapper for function success
|
||||
*/
|
||||
private function _success($retval = '', $code = null)
|
||||
{
|
||||
/**
|
||||
* Wrapper for function success
|
||||
*/
|
||||
private function _success($retval = '', $code = null)
|
||||
{
|
||||
return success($retval, $code, MessageLib::MSG_INDX_PREFIX);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function parseMessageText($text, $data = array())
|
||||
{
|
||||
return $this->ci->parser->parse_string($text, $data, true);
|
||||
|
||||
@@ -9,9 +9,9 @@ class VorlageLib
|
||||
/**
|
||||
* Loads parser library and OrganisationseinheitLib library
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
require_once APPPATH.'config/message.php';
|
||||
public function __construct()
|
||||
{
|
||||
require_once APPPATH.'config/message.php';
|
||||
|
||||
$this->ci =& get_instance();
|
||||
|
||||
@@ -21,83 +21,83 @@ class VorlageLib
|
||||
$this->ci->load->model('system/Vorlage_model', 'VorlageModel');
|
||||
$this->ci->load->model('system/Vorlagestudiengang_model', 'VorlageStudiengangModel');
|
||||
|
||||
$this->ci->load->helper('language');
|
||||
// Loads helper message to manage returning messages
|
||||
$this->ci->load->helper('language');
|
||||
// Loads helper message to manage returning messages
|
||||
$this->ci->load->helper('message');
|
||||
//$this->ci->lang->load('fhcomplete');
|
||||
}
|
||||
//$this->ci->lang->load('fhcomplete');
|
||||
}
|
||||
|
||||
/**
|
||||
* getVorlage() - will load a spezific Template
|
||||
*
|
||||
* @param int $vorlage_kurzbz REQUIRED
|
||||
* @return struct
|
||||
*/
|
||||
public function getVorlage($vorlage_kurzbz)
|
||||
{
|
||||
if (empty($vorlage_kurzbz))
|
||||
return error(MSG_ERR_INVALID_MSG_ID);
|
||||
|
||||
$vorlage = $this->ci->VorlageModel->load($vorlage_kurzbz);
|
||||
return $vorlage;
|
||||
}
|
||||
|
||||
/**
|
||||
* getSubMessages() - will return all Messages subordinated from a specified message.
|
||||
*
|
||||
* @param int $msg_id REQUIRED
|
||||
* @return array
|
||||
*/
|
||||
public function getVorlageByMimetype($mimetype = null)
|
||||
{
|
||||
$vorlage = $this->ci->VorlageModel->loadWhere(array('mimetype' => $mimetype));
|
||||
return $vorlage;
|
||||
}
|
||||
|
||||
/**
|
||||
* saveVorlage() - will save a spezific Template.
|
||||
*
|
||||
* @param array $data REQUIRED
|
||||
* @return array
|
||||
*/
|
||||
public function saveVorlage($vorlage_kurzbz, $data)
|
||||
{
|
||||
if (empty($data))
|
||||
return error(MSG_ERR_INVALID_MSG_ID);
|
||||
|
||||
$vorlage = $this->ci->VorlageModel->update($vorlage_kurzbz, $data);
|
||||
return $vorlage;
|
||||
}
|
||||
|
||||
/**
|
||||
* getVorlagetextByVorlage() - will load tbl_vorlagestudiengang for a spezific Template.
|
||||
*
|
||||
* @param string $vorlage_kurzbz REQUIRED
|
||||
* @return array
|
||||
*/
|
||||
public function getVorlagetextByVorlage($vorlage_kurzbz)
|
||||
* getVorlage() - will load a spezific Template
|
||||
*
|
||||
* @param int $vorlage_kurzbz REQUIRED
|
||||
* @return struct
|
||||
*/
|
||||
public function getVorlage($vorlage_kurzbz)
|
||||
{
|
||||
if (empty($vorlage_kurzbz))
|
||||
return error($this->ci->lang->line('fhc_'.FHC_INVALIDID, false));
|
||||
if (empty($vorlage_kurzbz))
|
||||
return error(MSG_ERR_INVALID_MSG_ID);
|
||||
|
||||
$vorlage = $this->ci->VorlageStudiengangModel->loadWhere(array('vorlage_kurzbz' => $vorlage_kurzbz));
|
||||
return $vorlage;
|
||||
}
|
||||
$vorlage = $this->ci->VorlageModel->load($vorlage_kurzbz);
|
||||
return $vorlage;
|
||||
}
|
||||
|
||||
/**
|
||||
* loadVorlagetext() - will load the best fitting Template.
|
||||
*
|
||||
* @param string $vorlage_kurzbz REQUIRED
|
||||
* @param string $oe_kurzbz OPTIONAL
|
||||
* @param string $orgform_kurzbz OPTIONAL
|
||||
* getSubMessages() - will return all Messages subordinated from a specified message.
|
||||
*
|
||||
* @param int $msg_id REQUIRED
|
||||
* @return array
|
||||
*/
|
||||
public function getVorlageByMimetype($mimetype = null)
|
||||
{
|
||||
$vorlage = $this->ci->VorlageModel->loadWhere(array('mimetype' => $mimetype));
|
||||
return $vorlage;
|
||||
}
|
||||
|
||||
/**
|
||||
* saveVorlage() - will save a spezific Template.
|
||||
*
|
||||
* @param array $data REQUIRED
|
||||
* @return array
|
||||
*/
|
||||
public function saveVorlage($vorlage_kurzbz, $data)
|
||||
{
|
||||
if (empty($data))
|
||||
return error(MSG_ERR_INVALID_MSG_ID);
|
||||
|
||||
$vorlage = $this->ci->VorlageModel->update($vorlage_kurzbz, $data);
|
||||
return $vorlage;
|
||||
}
|
||||
|
||||
/**
|
||||
* getVorlagetextByVorlage() - will load tbl_vorlagestudiengang for a spezific Template.
|
||||
*
|
||||
* @param string $vorlage_kurzbz REQUIRED
|
||||
* @return array
|
||||
*/
|
||||
public function getVorlagetextByVorlage($vorlage_kurzbz)
|
||||
{
|
||||
if (empty($vorlage_kurzbz))
|
||||
return error($this->ci->lang->line('fhc_'.FHC_INVALIDID, false));
|
||||
|
||||
$vorlage = $this->ci->VorlageStudiengangModel->loadWhere(array('vorlage_kurzbz' => $vorlage_kurzbz));
|
||||
return $vorlage;
|
||||
}
|
||||
|
||||
/**
|
||||
* loadVorlagetext() - will load the best fitting Template.
|
||||
*
|
||||
* @param string $vorlage_kurzbz REQUIRED
|
||||
* @param string $oe_kurzbz OPTIONAL
|
||||
* @param string $orgform_kurzbz OPTIONAL
|
||||
* @param string $sprache OPTIONAL
|
||||
* @return array
|
||||
*/
|
||||
public function loadVorlagetext($vorlage_kurzbz, $oe_kurzbz = null, $orgform_kurzbz = null, $sprache = null)
|
||||
* @return array
|
||||
*/
|
||||
public function loadVorlagetext($vorlage_kurzbz, $oe_kurzbz = null, $orgform_kurzbz = null, $sprache = null)
|
||||
{
|
||||
if (empty($vorlage_kurzbz))
|
||||
return error($this->ci->lang->line('fhc_'.FHC_INVALIDID, false));
|
||||
|
||||
if (empty($vorlage_kurzbz))
|
||||
return error($this->ci->lang->line('fhc_'.FHC_INVALIDID, false));
|
||||
|
||||
// Try to search the template with the given vorlage_kurzbz and other parameters if present
|
||||
$queryParameters = array("vorlage_kurzbz" => $vorlage_kurzbz, "aktiv" => true);
|
||||
|
||||
@@ -120,7 +120,7 @@ class VorlageLib
|
||||
{
|
||||
// Builds where clause
|
||||
$where = $this->_where($vorlage_kurzbz, $orgform_kurzbz, $sprache);
|
||||
|
||||
|
||||
$vorlage = $this->ci->organisationseinheitlib->treeSearch(
|
||||
'public',
|
||||
'tbl_vorlagestudiengang',
|
||||
@@ -133,17 +133,17 @@ class VorlageLib
|
||||
);
|
||||
}
|
||||
|
||||
return $vorlage;
|
||||
}
|
||||
return $vorlage;
|
||||
}
|
||||
|
||||
/**
|
||||
* _where
|
||||
*/
|
||||
private function _where($vorlage_kurzbz, $orgform_kurzbz, $sprache)
|
||||
{
|
||||
/**
|
||||
* _where
|
||||
*/
|
||||
private function _where($vorlage_kurzbz, $orgform_kurzbz, $sprache)
|
||||
{
|
||||
// Builds where clause
|
||||
$where = "vorlage_kurzbz = ".$this->ci->VorlageModel->escape($vorlage_kurzbz);
|
||||
|
||||
|
||||
if (is_null($sprache))
|
||||
{
|
||||
$where .= " AND sprache IS NULL";
|
||||
@@ -152,60 +152,60 @@ class VorlageLib
|
||||
{
|
||||
$where .= " AND sprache = ".$this->ci->VorlageModel->escape($sprache);
|
||||
}
|
||||
|
||||
|
||||
$where .= " AND aktiv = true";
|
||||
|
||||
|
||||
return $where;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* insertVorlagetext() - will load tbl_vorlagestudiengang for a spezific Template.
|
||||
*
|
||||
* @param string $vorlage_kurzbz REQUIRED
|
||||
* @return array
|
||||
*/
|
||||
public function insertVorlagetext($data)
|
||||
* insertVorlagetext() - will load tbl_vorlagestudiengang for a spezific Template.
|
||||
*
|
||||
* @param string $vorlage_kurzbz REQUIRED
|
||||
* @return array
|
||||
*/
|
||||
public function insertVorlagetext($data)
|
||||
{
|
||||
$vorlagetext = $this->ci->VorlageStudiengangModel->insert($data);
|
||||
return $vorlagetext;
|
||||
}
|
||||
$vorlagetext = $this->ci->VorlageStudiengangModel->insert($data);
|
||||
return $vorlagetext;
|
||||
}
|
||||
|
||||
/**
|
||||
* loadVorlagetext() - will load tbl_vorlagestudiengang for a spezific Template.
|
||||
*
|
||||
* @param string $vorlage_kurzbz REQUIRED
|
||||
* @return array
|
||||
*/
|
||||
public function getVorlagetextById($vorlagestudiengang_id)
|
||||
* loadVorlagetext() - will load tbl_vorlagestudiengang for a spezific Template.
|
||||
*
|
||||
* @param string $vorlage_kurzbz REQUIRED
|
||||
* @return array
|
||||
*/
|
||||
public function getVorlagetextById($vorlagestudiengang_id)
|
||||
{
|
||||
$vorlagetext = $this->ci->VorlageStudiengangModel->load($vorlagestudiengang_id);
|
||||
return $vorlagetext;
|
||||
}
|
||||
$vorlagetext = $this->ci->VorlageStudiengangModel->load($vorlagestudiengang_id);
|
||||
return $vorlagetext;
|
||||
}
|
||||
|
||||
/**
|
||||
* saveVorlagetext() - will load tbl_vorlagestudiengang for a spezific Template.
|
||||
*
|
||||
* @param string $vorlage_kurzbz REQUIRED
|
||||
* @return array
|
||||
*/
|
||||
public function updateVorlagetext($vorlagestudiengang_id, $data)
|
||||
* saveVorlagetext() - will load tbl_vorlagestudiengang for a spezific Template.
|
||||
*
|
||||
* @param string $vorlage_kurzbz REQUIRED
|
||||
* @return array
|
||||
*/
|
||||
public function updateVorlagetext($vorlagestudiengang_id, $data)
|
||||
{
|
||||
$vorlagetext = $this->ci->VorlageStudiengangModel->update($vorlagestudiengang_id, $data);
|
||||
return $vorlagetext;
|
||||
}
|
||||
$vorlagetext = $this->ci->VorlageStudiengangModel->update($vorlagestudiengang_id, $data);
|
||||
return $vorlagetext;
|
||||
}
|
||||
|
||||
/**
|
||||
* parseVorlagetext() - will parse a Vorlagetext.
|
||||
*
|
||||
* @param string $text REQUIRED
|
||||
* @param array $data REQUIRED
|
||||
* @return string
|
||||
*/
|
||||
public function parseVorlagetext($text, $data = array())
|
||||
* parseVorlagetext() - will parse a Vorlagetext.
|
||||
*
|
||||
* @param string $text REQUIRED
|
||||
* @param array $data REQUIRED
|
||||
* @return string
|
||||
*/
|
||||
public function parseVorlagetext($text, $data = array())
|
||||
{
|
||||
if (empty($text))
|
||||
return error($this->ci->lang->line('fhc_'.FHC_INVALIDID, false));
|
||||
if (empty($text))
|
||||
return error($this->ci->lang->line('fhc_'.FHC_INVALIDID, false));
|
||||
$text = $this->ci->parser->parse_string($text, $data, true);
|
||||
return $text;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -201,10 +201,12 @@ class Prestudent_model extends DB_Model
|
||||
*/
|
||||
public function getPrestudentWithZgv($prestudent_id)
|
||||
{
|
||||
$this->addSelect('tbl_prestudent.*, tbl_studiengang.kurzbzlang as studiengang, tbl_studiengang.bezeichnung as studiengangbezeichnung, tbl_studiengang.english as studiengangenglish, tbl_studiengang.typ as studiengangtyp,
|
||||
tbl_zgv.zgv_code, tbl_zgv.zgv_bez, tbl_prestudent.zgvort, tbl_prestudent.zgvdatum, tbl_prestudent.zgvnation as zgvnation_code, zgvnat.kurztext as zgvnation_kurzbez, zgvnat.langtext as zgvnation_bez, zgvnat.engltext as zgvnation_englbez,
|
||||
tbl_zgvmaster.zgvmas_code, tbl_zgvmaster.zgvmas_bez, tbl_prestudent.zgvmaort, tbl_prestudent.zgvmadatum, tbl_prestudent.zgvmanation as zgvmanation_code, zgvmanat.kurztext as zgvmanation_kurzbez, zgvmanat.langtext as zgvmanation_bez, zgvmanat.engltext as zgvmanation_englbez');
|
||||
$this->addSelect('tbl_prestudent.*, tbl_studiengang.studiengang_kz, tbl_studiengang.kurzbzlang as studiengang, tbl_studiengang.bezeichnung as studiengangbezeichnung, tbl_studiengang.english as studiengangenglish,
|
||||
tbl_studiengang.email as studiengangmail, tbl_studiengang.typ as studiengangtyp, tbl_studiengangstyp.bezeichnung as studiengangtyp_bez,
|
||||
tbl_zgv.zgv_code, tbl_zgv.zgv_bez, tbl_prestudent.zgvnation as zgvnation_code, zgvnat.kurztext as zgvnation_kurzbez, zgvnat.langtext as zgvnation_bez, zgvnat.engltext as zgvnation_englbez,
|
||||
tbl_zgvmaster.zgvmas_code, tbl_zgvmaster.zgvmas_bez, tbl_prestudent.zgvmanation as zgvmanation_code, zgvmanat.kurztext as zgvmanation_kurzbez, zgvmanat.langtext as zgvmanation_bez, zgvmanat.engltext as zgvmanation_englbez');
|
||||
$this->addJoin('public.tbl_studiengang', 'studiengang_kz', 'LEFT');
|
||||
$this->addJoin('public.tbl_studiengangstyp', 'typ', 'LEFT');
|
||||
$this->addJoin('bis.tbl_zgv', 'zgv_code', 'LEFT');
|
||||
$this->addJoin('bis.tbl_zgvmaster', 'zgvmas_code', 'LEFT');
|
||||
$this->addJoin('bis.tbl_nation zgvnat', 'zgvnation = zgvnat.nation_code', 'LEFT');
|
||||
@@ -223,13 +225,13 @@ class Prestudent_model extends DB_Model
|
||||
return error($lastStatus->retval);
|
||||
}
|
||||
|
||||
if(count($lastStatus->retval) > 0)
|
||||
if (count($lastStatus->retval) > 0)
|
||||
{
|
||||
$this->load->model('system/sprache_model', 'SpracheModel');
|
||||
$language = $this->SpracheModel->load($lastStatus->retval[0]->sprache);
|
||||
if($language->error)
|
||||
if ($language->error)
|
||||
return error($language->retval);
|
||||
if(count($language->retval) > 0)
|
||||
if (count($language->retval) > 0)
|
||||
$lastStatus->retval[0]->sprachedetails = $language->retval[0];
|
||||
$prestudent->retval[0]->prestudentstatus = $lastStatus->retval[0];
|
||||
}
|
||||
@@ -237,4 +239,27 @@ class Prestudent_model extends DB_Model
|
||||
return success($prestudent->retval);
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the prestudent edited last.
|
||||
* if no updateamum, sort by insertamum
|
||||
* @param $person_id
|
||||
* @param bool $withzgv if true, only prestudenten with zgv_code are taken
|
||||
* @return array|null
|
||||
*/
|
||||
public function getLastPrestudent($person_id, $withzgv = false)
|
||||
{
|
||||
$qry = 'SELECT * FROM public.tbl_prestudent
|
||||
WHERE person_id = ?
|
||||
%s
|
||||
ORDER BY updateamum DESC NULLS LAST, insertamum DESC NULLS LAST
|
||||
LIMIT 1';
|
||||
|
||||
$zgvwhere = $withzgv === true ? 'AND zgv_code IS NOT NULL' : '';
|
||||
|
||||
$qry = sprintf($qry, $zgvwhere);
|
||||
|
||||
$parametersArray = array($person_id);
|
||||
|
||||
return $this->execQuery($qry, $parametersArray);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -144,6 +144,19 @@ class Notiz_model extends DB_Model
|
||||
|
||||
return $this->loadWhere(array('person_id' => $person_id));
|
||||
}
|
||||
|
||||
/**
|
||||
* gets all Notizen for a person with a specific title
|
||||
* @param $person_id
|
||||
* @param $titel
|
||||
*/
|
||||
public function getNotizByTitel($person_id, $titel)
|
||||
{
|
||||
// Join with the table public.tbl_notizzuordnung using notiz_id
|
||||
$this->addJoin('public.tbl_notizzuordnung', 'notiz_id');
|
||||
|
||||
return $this->loadWhere(array('person_id' => $person_id, 'titel' => $titel));
|
||||
}
|
||||
// ------------------------------------------------------------------------------------------------------
|
||||
|
||||
}
|
||||
|
||||
@@ -209,5 +209,4 @@ class Person_model extends DB_Model
|
||||
|
||||
return $this->loadWhere(array('uid' => $uid));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Enables content locking.
|
||||
* An entry in the locktable means certain content is marked locked and a user is its editor.
|
||||
*/
|
||||
class PersonLock_model extends DB_Model
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->dbTable = 'system.tbl_person_lock';
|
||||
$this->pk = 'lock_id';
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if a specific person is locked. By default, looks for entries with no app in locktable for the person.
|
||||
* Alternatively, looks only for locks in a certain app.
|
||||
* @param $person_id
|
||||
* @param null $app
|
||||
* @return array all locks for a person if locked, null otherwise
|
||||
*/
|
||||
public function checkIfLocked($person_id, $app = null)
|
||||
{
|
||||
$lockdata = array('person_id' => $person_id, 'app' => $app);
|
||||
|
||||
$result = $this->loadWhere($lockdata);
|
||||
|
||||
if ($result->error)
|
||||
return error($result->retval);
|
||||
|
||||
if (count($result->retval) > 0)
|
||||
return success($result->retval);
|
||||
else
|
||||
return success(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Locks a person. Returns null if person was not locked (e.g. when already locked).
|
||||
* @param $person_id
|
||||
* @param $uid user who locks the person
|
||||
* @param $app optional, application in which person is locked
|
||||
* @return array inserted lock id if person was locked, null otherwise
|
||||
*/
|
||||
public function lockPerson($person_id, $uid, $app = null)
|
||||
{
|
||||
$locked = $this->checkIfLocked($person_id, $app);
|
||||
|
||||
if ($locked->error)
|
||||
return error($locked->retval);
|
||||
|
||||
//insert only if not already locked
|
||||
if ($locked->retval === null)
|
||||
return $this->insert(array('person_id' => $person_id, 'uid' => $uid, 'app' => $app));
|
||||
else
|
||||
return success(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a lock for a person. By default, removes any entries in locktable for the person.
|
||||
* Alternatively, removes only locks in a certain app.
|
||||
* @param $person_id
|
||||
* @param null $app
|
||||
* @return array deleted lock ids if person was locked, null otherwise
|
||||
*/
|
||||
public function unlockPerson($person_id, $app = null)
|
||||
{
|
||||
$deleted = array();
|
||||
$locks = $this->checkIfLocked($person_id, $app);
|
||||
|
||||
if ($locks->retval === null)
|
||||
return success(null);
|
||||
|
||||
foreach ($locks->retval as $lock)
|
||||
{
|
||||
$result = $this->delete($lock->lock_id);
|
||||
if ($result->error)
|
||||
return error($result->retval);
|
||||
|
||||
$deleted[] = $lock;
|
||||
}
|
||||
|
||||
return success($deleted);
|
||||
}
|
||||
}
|
||||
@@ -261,6 +261,7 @@ class Recipient_model extends DB_Model
|
||||
ks.kontakt as sender,
|
||||
kr.kontakt as receiver,
|
||||
mu.mitarbeiter_uid as employeeContact,
|
||||
ms.mitarbeiter_uid as senderemployeeContact,
|
||||
mr.person_id as receiver_id,
|
||||
mr.token,
|
||||
mm.subject,
|
||||
@@ -278,7 +279,13 @@ class Recipient_model extends DB_Model
|
||||
m.mitarbeiter_uid
|
||||
FROM public.tbl_benutzer b INNER JOIN public.tbl_mitarbeiter m ON(b.uid = m.mitarbeiter_uid)
|
||||
WHERE b.aktiv = TRUE
|
||||
) mu ON (mu.person_id = mr.person_id)';
|
||||
) mu ON (mu.person_id = mr.person_id)
|
||||
LEFT JOIN (
|
||||
SELECT b.person_id,
|
||||
m.mitarbeiter_uid
|
||||
FROM public.tbl_benutzer b INNER JOIN public.tbl_mitarbeiter m ON(b.uid = m.mitarbeiter_uid)
|
||||
WHERE b.aktiv = TRUE
|
||||
) ms ON (ms.person_id = mm.person_id)';
|
||||
|
||||
$parametersArray = array($kontaktType, $kontaktType);
|
||||
|
||||
|
||||
@@ -4,12 +4,13 @@
|
||||
array(
|
||||
'title' => 'Info Center',
|
||||
'jquery' => true,
|
||||
'jqueryui' => true,
|
||||
'bootstrap' => true,
|
||||
'fontawesome' => true,
|
||||
'sbadmintemplate' => true,
|
||||
'tablesorter' => true,
|
||||
'customCSSs' => 'skin/tablesort_bootstrap.css',
|
||||
'customJSs' => array('include/js/infocenterPersonDataset.js', 'include/js/bootstrapper.js')
|
||||
'customJSs' => array('include/js/bootstrapper.js', 'include/js/infocenter/infocenterPersonDataset.js')
|
||||
)
|
||||
);
|
||||
?>
|
||||
@@ -40,9 +41,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$("#tableDataset").addClass('table table-bordered table-responsive');
|
||||
</script>
|
||||
</body>
|
||||
|
||||
<?php $this->load->view('templates/FHC-Footer'); ?>
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
<?php
|
||||
|
||||
$APP = 'infocenter';
|
||||
|
||||
$filterWidgetArray = array(
|
||||
'query' => '
|
||||
SELECT
|
||||
@@ -60,8 +63,24 @@
|
||||
AND ps.person_id = p.person_id
|
||||
AND tbl_studiengang.typ in(\'b\')
|
||||
LIMIT 1
|
||||
) AS "AnzahlAbgeschickt"
|
||||
) AS "AnzahlAbgeschickt",
|
||||
array_to_string(
|
||||
(
|
||||
SELECT array_agg(tbl_studiengang.kurzbzlang)
|
||||
FROM
|
||||
public.tbl_prestudentstatus pss
|
||||
INNER JOIN public.tbl_prestudent ps USING(prestudent_id)
|
||||
JOIN public.tbl_studiengang USING(studiengang_kz)
|
||||
WHERE pss.status_kurzbz = \'Interessent\'
|
||||
AND pss.bewerbung_abgeschicktamum IS NOT NULL
|
||||
AND ps.person_id = p.person_id
|
||||
AND tbl_studiengang.typ in(\'b\')
|
||||
LIMIT 1
|
||||
),\',\'
|
||||
) AS "StgAbgeschickt",
|
||||
pl.zeitpunkt AS "LockDate"
|
||||
FROM public.tbl_person p
|
||||
LEFT JOIN (SELECT person_id, zeitpunkt FROM system.tbl_person_lock WHERE app = \''.$APP.'\') pl USING(person_id)
|
||||
WHERE
|
||||
EXISTS(
|
||||
SELECT 1
|
||||
@@ -96,46 +115,49 @@
|
||||
',
|
||||
'hideHeader' => false,
|
||||
'hideSave' => false,
|
||||
'checkboxes' => array('PersonId'),
|
||||
'checkboxes' => 'PersonId',
|
||||
'additionalColumns' => array('Details'),
|
||||
'formatRaw' => function($fieldName, $fieldValue, $datasetRaw) {
|
||||
'formatRaw' => function($datasetRaw) {
|
||||
|
||||
if ($fieldName == 'Details')
|
||||
$datasetRaw->{'Details'} = sprintf(
|
||||
'<a href="%s%s">Details</a>',
|
||||
base_url('index.ci.php/system/infocenter/InfoCenter/showDetails/'),
|
||||
$datasetRaw->{'PersonId'}
|
||||
);
|
||||
|
||||
if ($datasetRaw->{'SendDate'} == null)
|
||||
{
|
||||
$link = '<a href="%s%s">Details</a>';
|
||||
|
||||
$datasetRaw->{$fieldName} = sprintf(
|
||||
$link,
|
||||
base_url('index.ci.php/system/infocenter/InfoCenter/showDetails/'),
|
||||
$datasetRaw->PersonId
|
||||
);
|
||||
$datasetRaw->{'SendDate'} = 'Not sent';
|
||||
}
|
||||
|
||||
if ($fieldName == 'SendDate')
|
||||
if ($datasetRaw->{'LastAction'} == null)
|
||||
{
|
||||
if ($datasetRaw->{$fieldName} == '01.01.1970 01:00:00')
|
||||
{
|
||||
$datasetRaw->{$fieldName} = 'Not sent';
|
||||
}
|
||||
$datasetRaw->{'LastAction'} = 'Not logged';
|
||||
}
|
||||
|
||||
if ($fieldName == 'LastAction')
|
||||
if ($datasetRaw->{'User/Operator'} == '')
|
||||
{
|
||||
if ($datasetRaw->{$fieldName} == '01.01.1970 01:00:00')
|
||||
{
|
||||
$datasetRaw->{$fieldName} = 'Not logged';
|
||||
}
|
||||
$datasetRaw->{'User/Operator'} = 'NA';
|
||||
}
|
||||
|
||||
if ($fieldName == 'User/Operator')
|
||||
if ($datasetRaw->{'LockDate'} == null)
|
||||
{
|
||||
if ($datasetRaw->{$fieldName} == '')
|
||||
{
|
||||
$datasetRaw->{$fieldName} = 'NA';
|
||||
}
|
||||
$datasetRaw->{'LockDate'} = 'Not locked';
|
||||
}
|
||||
|
||||
if ($datasetRaw->{'StgAbgeschickt'} == null)
|
||||
{
|
||||
$datasetRaw->{'StgAbgeschickt'} = 'N/A';
|
||||
}
|
||||
|
||||
return $datasetRaw;
|
||||
},
|
||||
'markRow' => function($datasetRaw) {
|
||||
|
||||
if ($datasetRaw->LockDate != null)
|
||||
{
|
||||
return FilterWidget::DEFAULT_MARK_ROW_CLASS;
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
@@ -147,7 +169,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
$filterWidgetArray['app'] = 'infocenter';
|
||||
$filterWidgetArray['app'] = $APP;
|
||||
$filterWidgetArray['datasetName'] = 'PersonActions';
|
||||
$filterWidgetArray['filterKurzbz'] = 'InfoCenterNotSentApplicationAll';
|
||||
}
|
||||
|
||||
@@ -1,19 +1,27 @@
|
||||
<?php
|
||||
$this->load->view(
|
||||
'templates/FHC-Header',
|
||||
array(
|
||||
'title' => 'InfocenterDetails',
|
||||
'jquery' => true,
|
||||
'bootstrap' => true,
|
||||
'fontawesome' => true,
|
||||
'jqueryui' => true,
|
||||
'tablesorter' => true,
|
||||
'tinymce' => true,
|
||||
'sbadmintemplate' => true,
|
||||
'customCSSs' => array('skin/admintemplate.css', 'skin/tablesort_bootstrap.css'),
|
||||
'customJSs' => 'include/js/bootstrapper.js'
|
||||
)
|
||||
);
|
||||
$this->load->view(
|
||||
'templates/FHC-Header',
|
||||
array(
|
||||
'title' => 'InfocenterDetails',
|
||||
'jquery' => true,
|
||||
'bootstrap' => true,
|
||||
'fontawesome' => true,
|
||||
'jqueryui' => true,
|
||||
'tablesorter' => true,
|
||||
'tinymce' => true,
|
||||
'sbadmintemplate' => true,
|
||||
'customCSSs' =>
|
||||
array(
|
||||
'skin/admintemplate.css',
|
||||
'skin/tablesort_bootstrap.css'
|
||||
),
|
||||
'customJSs' =>
|
||||
array(
|
||||
'include/js/bootstrapper.js',
|
||||
'include/js/tablesort/tablesort.js',
|
||||
'include/js/infocenter/infocenterDetails.js')
|
||||
)
|
||||
);
|
||||
?>
|
||||
<body>
|
||||
<div id="wrapper">
|
||||
@@ -28,13 +36,27 @@ $this->load->view(
|
||||
?>
|
||||
<div id="page-wrapper">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<h3 class="page-header">Infocenter
|
||||
Details: <?php echo $stammdaten->vorname.' '.$stammdaten->nachname ?>
|
||||
</h3>
|
||||
<input type="hidden" id="hiddenpersonid" value="<?php echo $stammdaten->person_id ?>">
|
||||
<div class="row<?php if($lockedbyother) echo ' alert-danger' ?>">
|
||||
<div class="col-lg-8">
|
||||
<h3 class="page-header">
|
||||
Infocenter Details: <?php echo $stammdaten->vorname.' '.$stammdaten->nachname ?>
|
||||
</h3>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<div class="headerright text-right">
|
||||
wird bearbeitet von:
|
||||
<?php
|
||||
if(isset($lockedby)):
|
||||
echo $lockedby;
|
||||
?>
|
||||
|
||||
<a href="../unlockPerson/<?php echo $stammdaten->person_id; ?>"><i class="fa fa-sign-out"></i> Freigeben</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<section>
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
@@ -124,27 +146,9 @@ $this->load->view(
|
||||
</div> <!-- ./wrapper -->
|
||||
|
||||
<script>
|
||||
|
||||
$(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"]);
|
||||
addTablesorter("logtable", [[0, 1]], ["filter"]);
|
||||
addTablesorter("notiztable", [[0, 1]], ["filter"]);
|
||||
|
||||
//add pager
|
||||
togglePager(23, "logtable", "logpager");
|
||||
togglePager(10, "notiztable", "notizpager");
|
||||
|
||||
//initialise datepicker
|
||||
$.datepicker.setDefaults($.datepicker.regional['de']);
|
||||
$(".dateinput").datepicker({
|
||||
"dateFormat": "dd.mm.yy"
|
||||
});
|
||||
|
||||
//add click events to "formal geprüft" checkboxes
|
||||
<?php foreach($dokumente as $dokument): ?>
|
||||
|
||||
@@ -157,75 +161,8 @@ $this->load->view(
|
||||
}
|
||||
<?php endforeach ?>
|
||||
|
||||
//prevent opening modal when Statusgrund not chosen
|
||||
$("#absageModal").on('show.bs.modal', function (e)
|
||||
{
|
||||
if ($("[name=statusgrund]").val() === "null")
|
||||
{
|
||||
$("#statusgrselect").addClass("has-error");
|
||||
return e.preventDefault();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
$("[name=statusgrund]").change(function ()
|
||||
{
|
||||
$("#statusgrselect").removeClass("has-error");
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
function addTablesorter(tableid, sortList, widgets)
|
||||
{
|
||||
$("#" + tableid).tablesorter(
|
||||
{
|
||||
theme: "default",
|
||||
dateFormat: "ddmmyyyy",
|
||||
sortList: sortList,
|
||||
widgets: widgets
|
||||
}
|
||||
);
|
||||
|
||||
//hide filters if less than 2 datarows (+ 2 for headings and filter row itself)
|
||||
if ($("#" + tableid + " tr").length < 4)
|
||||
{
|
||||
$("#" + tableid + " tr.tablesorter-filter-row").hide();
|
||||
}
|
||||
}
|
||||
|
||||
function togglePager(size, tableid, pagerid)
|
||||
{
|
||||
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 on first 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} Zeilen'
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
|
||||
@@ -80,7 +80,9 @@
|
||||
<?php echo isset($adresse) ? $adresse->strasse.', '.$adresse->plz.' '.$adresse->ort : '' ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo ($adresse->heimatadresse === true ? 'Heimatadresse' : '').($adresse->heimatadresse === true && $adresse->rechnungsadresse === true ? ', ' : '').($adresse->rechnungsadresse === true ? 'Rechnungsadresse' : ''); ?>
|
||||
<?php echo ($adresse->heimatadresse === true ? 'Heimatadresse' : '').
|
||||
($adresse->heimatadresse === true && $adresse->rechnungsadresse === true ? ', ' : '').
|
||||
($adresse->rechnungsadresse === true ? 'Rechnungsadresse' : ''); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
@@ -103,13 +105,4 @@
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
//add submit event to message send link
|
||||
$("#sendmsglink").click(
|
||||
function ()
|
||||
{
|
||||
$("#sendmsgform").submit();
|
||||
}
|
||||
);
|
||||
</script>
|
||||
</div>
|
||||
@@ -35,7 +35,7 @@
|
||||
<?php
|
||||
if (isset($zgvpruefung->prestudentstatus->status_kurzbz))
|
||||
{
|
||||
echo $zgvpruefung->prestudentstatus->status_kurzbz.(isset($zgvpruefung->prestudentstatus->bezeichnung_statusgrund[0]) && $zgvpruefung->prestudentstatus->status_kurzbz === 'Abgewiesener' ? ' ('.$zgvpruefung->prestudentstatus->bezeichnung_statusgrund[0].')' : '');
|
||||
echo $zgvpruefung->prestudentstatus->status_kurzbz.(isset($zgvpruefung->prestudentstatus->bezeichnung_statusgrund[0]) ? ' ('.$zgvpruefung->prestudentstatus->bezeichnung_statusgrund[0].')' : '');
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
@@ -57,12 +57,12 @@
|
||||
<div class="form-group">
|
||||
<label>Orgform: </label>
|
||||
<span style="display: inline-block">
|
||||
<?php
|
||||
$separator = (isset($zgvpruefung->prestudentstatus->orgform)) ? ', ' : '';
|
||||
echo (isset($zgvpruefung->prestudentstatus->orgform) ? $zgvpruefung->prestudentstatus->orgform : '')
|
||||
.(isset($zgvpruefung->prestudentstatus->sprachedetails->bezeichnung) ? $separator.$zgvpruefung->prestudentstatus->sprachedetails->bezeichnung[0] : '')
|
||||
.(isset($zgvpruefung->prestudentstatus->alternative) ? ' ('.$zgvpruefung->prestudentstatus->alternative.')' : '') ?>
|
||||
</span>
|
||||
<?php
|
||||
$separator = (isset($zgvpruefung->prestudentstatus->orgform)) ? ', ' : '';
|
||||
echo (isset($zgvpruefung->prestudentstatus->orgform) ? $zgvpruefung->prestudentstatus->orgform : '')
|
||||
.(isset($zgvpruefung->prestudentstatus->sprachedetails->bezeichnung) ? $separator.$zgvpruefung->prestudentstatus->sprachedetails->bezeichnung[0] : '')
|
||||
.(isset($zgvpruefung->prestudentstatus->alternative) ? ' ('.$zgvpruefung->prestudentstatus->alternative.')' : '') ?>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -76,7 +76,7 @@
|
||||
echo $this->widgetlib->widget(
|
||||
'Zgv_widget',
|
||||
array(DropdownWidget::SELECTED_ELEMENT => $zgvpruefung->zgv_code),
|
||||
array('name' => 'zgv', 'id' => 'zgv')
|
||||
array('name' => 'zgv', 'id' => 'zgv_'.$zgvpruefung->prestudent_id)
|
||||
); ?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -89,21 +89,23 @@
|
||||
?>
|
||||
<input type="text" class="form-control"
|
||||
value="<?php echo $zgvpruefung->zgvort ?>"
|
||||
name="zgvort">
|
||||
name="zgvort" id="zgvort_<?php echo $zgvpruefung->prestudent_id ?>">
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-<?php echo $columns[2] ?>">
|
||||
<div class="form-group">
|
||||
<label>ZGV Datum: </label>
|
||||
<?php if ($infoonly):
|
||||
echo date_format(date_create($zgvpruefung->zgvdatum), 'd.m.Y');
|
||||
<?php
|
||||
$zgvdatum = empty($zgvpruefung->zgvdatum) ? "" : date_format(date_create($zgvpruefung->zgvdatum), 'd.m.Y');
|
||||
if ($infoonly):
|
||||
echo $zgvdatum;
|
||||
else:
|
||||
?>
|
||||
<input type="text"
|
||||
class="dateinput form-control"
|
||||
value="<?php echo empty($zgvpruefung->zgvdatum) ? "" : date_format(date_create($zgvpruefung->zgvdatum), 'd.m.Y') ?>"
|
||||
name="zgvdatum">
|
||||
value="<?php echo $zgvdatum ?>"
|
||||
name="zgvdatum" id="zgvdatum_<?php echo $zgvpruefung->prestudent_id ?>">
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -116,7 +118,7 @@
|
||||
echo $this->widgetlib->widget(
|
||||
'Nation_widget',
|
||||
array(DropdownWidget::SELECTED_ELEMENT => $zgvpruefung->zgvnation_code),
|
||||
array('name' => 'zgvnation', 'id' => 'zgvnation')
|
||||
array('name' => 'zgvnation', 'id' => 'zgvnation_'.$zgvpruefung->prestudent_id)
|
||||
); ?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -153,13 +155,15 @@
|
||||
<div class="col-lg-<?php echo $columns[2] ?>">
|
||||
<div class="form-group">
|
||||
<label>ZGV Master Datum: </label>
|
||||
<?php if ($infoonly):
|
||||
echo date_format(date_create($zgvpruefung->zgvmadatum), 'd.m.Y');
|
||||
<?php
|
||||
$zgvmadatum = empty($zgvpruefung->zgvmadatum) ? "" : date_format(date_create($zgvpruefung->zgvmadatum), 'd.m.Y');
|
||||
if ($infoonly):
|
||||
echo $zgvmadatum;
|
||||
else:
|
||||
?>
|
||||
<input type="text"
|
||||
class="dateinput form-control"
|
||||
value="<?php echo empty($zgvpruefung->zgvmadatum) ? "" : date_format(date_create($zgvpruefung->zgvmadatum), 'd.m.Y') ?>"
|
||||
value="<?php echo $zgvmadatum ?>"
|
||||
name="zgvmadatum">
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
@@ -183,7 +187,12 @@
|
||||
<?php endif; ?>
|
||||
<?php if (!$infoonly): ?>
|
||||
<div class="row">
|
||||
<div class="col-lg-12 text-right">
|
||||
<div class="col-lg-6 text-left">
|
||||
<button type="button" class="btn btn-default zgvUebernehmen" id="zgvUebernehmen_<?php echo $zgvpruefung->prestudent_id ?>">
|
||||
Letzte ZGV übernehmen
|
||||
</button>
|
||||
</div>
|
||||
<div class="col-lg-6 text-right">
|
||||
<button type="submit" class="btn btn-default">
|
||||
Speichern
|
||||
</button>
|
||||
@@ -203,7 +212,7 @@
|
||||
<div class="form-inline">
|
||||
<form method="post"
|
||||
action="../saveAbsage/<?php echo $zgvpruefung->prestudent_id ?>">
|
||||
<div class="input-group" id="statusgrselect">
|
||||
<div class="input-group" id="statusgrselect_<?php echo $zgvpruefung->prestudent_id ?>">
|
||||
<select name="statusgrund"
|
||||
class="d-inline float-right"
|
||||
required>
|
||||
@@ -216,15 +225,15 @@
|
||||
<?php endforeach ?>
|
||||
</select>
|
||||
<span class="input-group-btn">
|
||||
<button id="absageBtn" type="button"
|
||||
class="btn btn-default"
|
||||
data-toggle="modal"
|
||||
data-target="#absageModal">
|
||||
Absage
|
||||
</button>
|
||||
</span>
|
||||
<button id="absageBtn" type="button"
|
||||
class="btn btn-default"
|
||||
data-toggle="modal"
|
||||
data-target="#absageModal_<?php echo $zgvpruefung->prestudent_id ?>">
|
||||
Absage
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
<div class="modal fade" id="absageModal"
|
||||
<div class="modal fade absageModal" id="absageModal_<?php echo $zgvpruefung->prestudent_id ?>"
|
||||
tabindex="-1"
|
||||
role="dialog"
|
||||
aria-labelledby="absageModalLabel"
|
||||
@@ -280,12 +289,12 @@
|
||||
<div>
|
||||
<button type="button" class="btn btn-default"
|
||||
data-toggle="modal"
|
||||
data-target="#freigabeModal">
|
||||
data-target="#freigabeModal_<?php echo $zgvpruefung->prestudent_id ?>">
|
||||
Freigabe an Studiengang
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="freigabeModal" tabindex="-1"
|
||||
<div class="modal fade" id="freigabeModal_<?php echo $zgvpruefung->prestudent_id ?>" tabindex="-1"
|
||||
role="dialog"
|
||||
aria-labelledby="freigabeModalLabel"
|
||||
aria-hidden="true">
|
||||
|
||||
@@ -27,7 +27,8 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<td valign="top">
|
||||
<br>
|
||||
<b>Message:</b>
|
||||
</td>
|
||||
<td>
|
||||
@@ -38,7 +39,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
if ($isEmployee === false)
|
||||
if ($isEmployee === false && $href != '')
|
||||
{
|
||||
?>
|
||||
<tr>
|
||||
@@ -48,7 +49,7 @@
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
?>
|
||||
</table>
|
||||
</center>
|
||||
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Interessentenfreigabe mail</title>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
{interessentbez} wurde freigegeben.
|
||||
<br><br>
|
||||
<table style="font-size:small">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><b>Studiengang</b></td>
|
||||
<td>{studiengangbez} {studiengangtypbez} {orgform} {sprache}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>Studiensemester</b></td>
|
||||
<td>{studiensemester}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>Geschlecht</b></td>
|
||||
<td>{geschlecht}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>Vorname</b></td>
|
||||
<td>{vorname}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>Nachname</b></td>
|
||||
<td>{nachname}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>Geburtsdatum</b></td>
|
||||
<td>{gebdatum}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>E-Mail Adresse</b></td>
|
||||
<td>{mailadresse}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>Prestudent ID</b></td>
|
||||
<td>{prestudentid}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top"><b>Anmerkungen zur Bewerbung</b></td>
|
||||
<td>{notizentext}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<br>
|
||||
Für mehr Details verwenden Sie die Personenansicht im FAS.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
<style>
|
||||
|
||||
.filter-name-title {
|
||||
font-family: inherit;
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
line-height: 1.1;
|
||||
color: black;
|
||||
}
|
||||
|
||||
.filters-hidden-panel {
|
||||
margin: 0 10px 10px 10px;
|
||||
}
|
||||
@@ -8,80 +16,166 @@
|
||||
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;
|
||||
}
|
||||
|
||||
.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: 90px;
|
||||
}
|
||||
|
||||
#addField {
|
||||
display: inline;
|
||||
width: 400px;
|
||||
}
|
||||
|
||||
#addFilter {
|
||||
display: inline;
|
||||
width: 400px;
|
||||
}
|
||||
|
||||
#selectedFilters {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
#customFilterDescription {
|
||||
display: inline;
|
||||
width: 400px;
|
||||
}
|
||||
|
||||
</style>
|
||||
<script language="Javascript" type="text/javascript">
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
$("#addField").change(function() {
|
||||
$("#filterForm").submit();
|
||||
});
|
||||
|
||||
$(".remove-field").each(function() {
|
||||
$(this).click(function() {
|
||||
$("#rmField").val($(this).attr('fieldToRemove'));
|
||||
$("#filterForm").submit();
|
||||
$("#removeFilterById").click(function() {
|
||||
$.ajax({
|
||||
url: "<?php echo base_url('index.ci.php/system/Filters/deleteCustomFilter'); ?>",
|
||||
method: "POST",
|
||||
data: {
|
||||
filter_id: $(this).attr('value')
|
||||
}
|
||||
})
|
||||
.done(function(data, textStatus, jqXHR) {
|
||||
alert("Filter successfully removed");
|
||||
}).fail(function(jqXHR, textStatus, errorThrown) {
|
||||
alert(textStatus);
|
||||
});
|
||||
});
|
||||
|
||||
$("#addFilter").change(function() {
|
||||
$("#filterForm").submit();
|
||||
});
|
||||
$("[data-toggle='collapse']").click(function() {
|
||||
|
||||
$(".remove-filter").each(function() {
|
||||
$(this).click(function() {
|
||||
$("#rmFilter").val($(this).attr('filterToRemove'));
|
||||
$("#filterForm").submit();
|
||||
});
|
||||
});
|
||||
var filterOptionsStatus = sessionStorage.getItem('filter-options-status');
|
||||
|
||||
$(".select-filter-operation").change(function() {
|
||||
$("#filterForm").submit();
|
||||
});
|
||||
|
||||
$(".select-filter-operation-value").keydown(function(event) {
|
||||
if (event.which == 13)
|
||||
if (filterOptionsStatus != null && filterOptionsStatus == 'closed')
|
||||
{
|
||||
$("#filterForm").submit();
|
||||
sessionStorage.setItem('filter-options-status', 'open');
|
||||
}
|
||||
else
|
||||
{
|
||||
sessionStorage.setItem('filter-options-status', 'closed');
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$("#saveCustomFilterButton").click(function() {
|
||||
$("#saveCustomFilter").val(true);
|
||||
$("#filterForm").submit();
|
||||
});
|
||||
|
||||
$("#applyFilter").click(function() {
|
||||
$("#filterForm").submit();
|
||||
});
|
||||
var filterOptionsStatus = sessionStorage.getItem('filter-options-status');
|
||||
if (filterOptionsStatus != null && filterOptionsStatus == 'open')
|
||||
{
|
||||
$('.collapse').collapse("show");
|
||||
}
|
||||
|
||||
});
|
||||
</script>
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<form class="form-inline" id="filterForm" method="POST" action="<?php echo current_url(); ?>">
|
||||
<div>
|
||||
<?php FilterWidget::loadViewSelectFields($listFields); ?>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<?php FilterWidget::loadViewSelectFilters($metaData); ?>
|
||||
</div>
|
||||
<?php FilterWidget::displayFilterName(); ?>
|
||||
|
||||
<div>
|
||||
<?php FilterWidget::loadViewSaveFilter(); ?>
|
||||
</div>
|
||||
<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>
|
||||
</h4>
|
||||
</div>
|
||||
<div id="collapseFilterHeader" class="panel-collapse collapse">
|
||||
<div class="filters-hidden-panel">
|
||||
<div>
|
||||
<?php FilterWidget::loadViewSelectFields(); ?>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
<br>
|
||||
|
||||
<div id="datasetActionsTop">
|
||||
</div>
|
||||
<div>
|
||||
<?php FilterWidget::loadViewSelectFilters(); ?>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<?php FilterWidget::loadViewTableDataset($dataset); ?>
|
||||
</div>
|
||||
<br>
|
||||
|
||||
<div id="datasetActionsBottom">
|
||||
<div>
|
||||
<?php FilterWidget::loadViewSaveFilter(); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
<div id="datasetActionsTop"></div>
|
||||
|
||||
<div>
|
||||
<?php FilterWidget::loadViewTableDataset(); ?>
|
||||
</div>
|
||||
|
||||
<div id="datasetActionsBottom"></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,7 +1,39 @@
|
||||
<script language="Javascript" type="text/javascript">
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
$("#saveCustomFilterButton").click(function() {
|
||||
if ($("#customFilterDescription").val() != '')
|
||||
{
|
||||
$.ajax({
|
||||
url: "<?php echo base_url('index.ci.php/system/Filters/saveFilter'); ?>",
|
||||
method: "POST",
|
||||
data: {
|
||||
customFilterDescription: $("#customFilterDescription").val()
|
||||
}
|
||||
})
|
||||
.done(function(data, textStatus, jqXHR) {
|
||||
alert("Filter successfully saved");
|
||||
}).fail(function(jqXHR, textStatus, errorThrown) {
|
||||
alert(textStatus);
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
alert("You forgot something!");
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<div>
|
||||
Filter description: <input type="text" id="customFilterDescription" name="customFilterDescription" value="">
|
||||
</div>
|
||||
<div>
|
||||
<input type="button" id="saveCustomFilterButton" value="Save filter">
|
||||
<input type="hidden" id="saveCustomFilter" name="saveCustomFilter" value="false">
|
||||
<span>
|
||||
Filter description: <input type="text" id="customFilterDescription" value="">
|
||||
</span>
|
||||
|
||||
<span>
|
||||
<input type="button" id="saveCustomFilterButton" value="Save filter">
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -1,63 +1,196 @@
|
||||
<div class="panel-group">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h4 class="panel-title">
|
||||
<a data-toggle="collapse" href="#collapseSelectFields">Select columns</a>
|
||||
</h4>
|
||||
</div>
|
||||
<div id="collapseSelectFields" class="panel-collapse collapse">
|
||||
<div class="filters-hidden-panel">
|
||||
<div>
|
||||
<?php
|
||||
$selectedFields = FilterWidget::getSelectedFields();
|
||||
$columnsAliases = FilterWidget::getColumnsAliases();
|
||||
<script language="Javascript" type="text/javascript">
|
||||
|
||||
for ($selectedFieldsCounter = 0; $selectedFieldsCounter < count($selectedFields); $selectedFieldsCounter++)
|
||||
{
|
||||
$selectedField = $selectedFields[$selectedFieldsCounter];
|
||||
$selectedFieldAlias = $selectedField;
|
||||
function dndSF()
|
||||
{
|
||||
$(".filter-select-field-dnd-span").draggable({
|
||||
containment: "parent",
|
||||
cursor: "move",
|
||||
opacity: 0.4,
|
||||
revert: "invalid",
|
||||
revertDuration: 200
|
||||
});
|
||||
|
||||
if ($columnsAliases != null)
|
||||
{
|
||||
$indx = array_search($selectedField, $listFields);
|
||||
if ($indx !== false)
|
||||
{
|
||||
$selectedFieldAlias = $columnsAliases[$indx];
|
||||
}
|
||||
}
|
||||
?>
|
||||
<input type="button" value="<?php echo $selectedFieldAlias; ?> X" class="remove-field" fieldToRemove="<?php echo $selectedField; ?>">
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<input type="hidden" id="<?php echo FilterWidget::CMD_REMOVE_FIELD; ?>" name="<?php echo FilterWidget::CMD_REMOVE_FIELD; ?>" value="">
|
||||
</div>
|
||||
<div>
|
||||
<span>
|
||||
Add field:
|
||||
</span>
|
||||
<span>
|
||||
<select id="<?php echo FilterWidget::CMD_ADD_FIELD; ?>" name="<?php echo FilterWidget::CMD_ADD_FIELD; ?>">
|
||||
<option value="">Select a field to add..</option>
|
||||
<?php
|
||||
for ($listFieldsCounter = 0; $listFieldsCounter < count($listFields); $listFieldsCounter++)
|
||||
{
|
||||
$listField = $listFields[$listFieldsCounter];
|
||||
$listFieldAlias = $listField;
|
||||
$(".filter-select-field-dnd-span").droppable({
|
||||
accept: ".filter-select-field-dnd-span",
|
||||
over: function(event, ui) {
|
||||
$(this).on("mousemove", function( event ) {
|
||||
var padding = 20;
|
||||
var elementCenter = $(this).offset().left + (padding + $(this).width() / 2);
|
||||
|
||||
if ($columnsAliases != null)
|
||||
{
|
||||
$listFieldAlias = $columnsAliases[$listFieldsCounter];
|
||||
}
|
||||
?>
|
||||
<option value="<?php echo $listField; ?>"><?php echo $listFieldAlias; ?></option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
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");
|
||||
}
|
||||
});
|
||||
},
|
||||
out: function(event, ui) {
|
||||
$(this).off("mousemove");
|
||||
$(this).removeClass("selection-before");
|
||||
$(this).removeClass("selection-after");
|
||||
},
|
||||
drop: function(event, ui) {
|
||||
var padding = 20;
|
||||
var elementCenter = $(this).offset().left + (padding + $(this).width() / 2);
|
||||
|
||||
if (event.pageX > elementCenter)
|
||||
{
|
||||
$(this).insertBefore(ui.draggable);
|
||||
}
|
||||
else if (event.pageX < elementCenter)
|
||||
{
|
||||
$(this).insertAfter(ui.draggable);
|
||||
}
|
||||
|
||||
$(this).off("mousemove");
|
||||
$(this).removeClass("selection-before");
|
||||
$(this).removeClass("selection-after");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function resetEventsSF()
|
||||
{
|
||||
$("#addField").off('change');
|
||||
$(".remove-field").off('click');
|
||||
}
|
||||
|
||||
function addEventsSF()
|
||||
{
|
||||
$("#addField").change(function(event) {
|
||||
|
||||
$.ajax({
|
||||
url: "<?php echo base_url('index.ci.php/system/Filters/addSelectedFields'); ?>",
|
||||
method: "POST",
|
||||
data: {
|
||||
fieldName: $(this).val()
|
||||
}
|
||||
})
|
||||
.done(function(data, textStatus, jqXHR) {
|
||||
|
||||
resetSelectedFields();
|
||||
renderSelectedFields();
|
||||
|
||||
renderTableDataset();
|
||||
|
||||
}).fail(function(jqXHR, textStatus, errorThrown) {
|
||||
alert(textStatus);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$(".remove-field").click(function(event) {
|
||||
|
||||
$.ajax({
|
||||
url: "<?php echo base_url('index.ci.php/system/Filters/removeSelectedFields'); ?>",
|
||||
method: "POST",
|
||||
data: {
|
||||
fieldName: $(this).attr('fieldToRemove')
|
||||
}
|
||||
})
|
||||
.done(function(data, textStatus, jqXHR) {
|
||||
|
||||
resetSelectedFields();
|
||||
renderSelectedFields();
|
||||
|
||||
renderTableDataset();
|
||||
|
||||
}).fail(function(jqXHR, textStatus, errorThrown) {
|
||||
alert(textStatus);
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
function renderSelectedFields()
|
||||
{
|
||||
$.ajax({
|
||||
url: "<?php echo base_url('index.ci.php/system/Filters/selectFields'); ?>",
|
||||
method: "GET",
|
||||
data: {},
|
||||
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 class="filter-select-field-dnd-span">';
|
||||
|
||||
strHtml += fieldToDisplay;
|
||||
strHtml += '<a class="remove-field" fieldToRemove="' + fieldName + '">X</a>';
|
||||
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.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>
|
||||
Add field:
|
||||
</span>
|
||||
|
||||
<span>
|
||||
<select id="addField"></select>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -1,82 +1,291 @@
|
||||
<div class="panel-group">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h4 class="panel-title">
|
||||
<a data-toggle="collapse" href="#collapseSelectFilters">Select filters</a>
|
||||
</h4>
|
||||
</div>
|
||||
<div id="collapseSelectFilters" class="panel-collapse collapse">
|
||||
<div class="filters-hidden-panel">
|
||||
<div>
|
||||
<?php
|
||||
$selectedFilters = FilterWidget::getSelectedFilters();
|
||||
$columnsAliases = FilterWidget::getColumnsAliases();
|
||||
<script language="Javascript" type="text/javascript">
|
||||
|
||||
for ($filtersCounter = 0; $filtersCounter < count($selectedFilters); $filtersCounter++)
|
||||
function resetEventsSFilters()
|
||||
{
|
||||
$("#addFilter").off('change');
|
||||
}
|
||||
|
||||
function addEventsSFilters()
|
||||
{
|
||||
$("#addFilter").change(function(event) {
|
||||
|
||||
$.ajax({
|
||||
url: "<?php echo base_url('index.ci.php/system/Filters/addSelectedFilters'); ?>",
|
||||
method: "POST",
|
||||
data: {
|
||||
fieldName: $(this).val()
|
||||
}
|
||||
})
|
||||
.done(function(data, textStatus, jqXHR) {
|
||||
|
||||
resetSelectedFilters();
|
||||
renderSelectedFilters();
|
||||
|
||||
renderTableDataset();
|
||||
|
||||
}).fail(function(jqXHR, textStatus, errorThrown) {
|
||||
alert(textStatus);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$(".remove-filter").click(function(event) {
|
||||
|
||||
$.ajax({
|
||||
url: "<?php echo base_url('index.ci.php/system/Filters/removeSelectedFilters'); ?>",
|
||||
method: "POST",
|
||||
data: {
|
||||
fieldName: $(this).attr('filterToRemove')
|
||||
}
|
||||
})
|
||||
.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 base_url('index.ci.php/system/Filters/applyFilter'); ?>",
|
||||
method: "POST",
|
||||
data: {
|
||||
filterNames: selectFilterName,
|
||||
filterOperations: selectFilterOperation,
|
||||
filterOperationValues: selectFilterOperationValue,
|
||||
filterOptions: selectFilterOption
|
||||
}
|
||||
})
|
||||
.done(function(data, textStatus, jqXHR) {
|
||||
|
||||
// Success
|
||||
|
||||
}).fail(function(jqXHR, textStatus, errorThrown) {
|
||||
|
||||
// Error
|
||||
|
||||
}).always(function() {
|
||||
|
||||
location.reload();
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
function renderSelectedFilterFields(metaData, activeFilters, activeFiltersOperation, activeFiltersOption)
|
||||
{
|
||||
var html = '';
|
||||
|
||||
if (metaData.type.toLowerCase().indexOf("int") >= 0)
|
||||
{
|
||||
html = '<span>';
|
||||
html += ' <select class="select-filter-operation form-control">';
|
||||
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="select-filter-operation-value form-control">';
|
||||
html += '</span>';
|
||||
}
|
||||
if (metaData.type.toLowerCase().indexOf('varchar') >= 0)
|
||||
{
|
||||
html = '<span>';
|
||||
html += ' <select class="select-filter-operation form-control">';
|
||||
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="select-filter-operation-value form-control">';
|
||||
html += '</span>';
|
||||
}
|
||||
if (metaData.type.toLowerCase().indexOf('bool') >= 0)
|
||||
{
|
||||
html = '<span>';
|
||||
html += ' <select class="select-filter-operation form-control">';
|
||||
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="select-filter-operation-value form-control">';
|
||||
html += '</span>';
|
||||
}
|
||||
if (metaData.type.toLowerCase().indexOf('timestamp') >= 0 || metaData.type.toLowerCase().indexOf('date') >= 0)
|
||||
{
|
||||
var classOperation = 'select-filter-operation-value form-control';
|
||||
var classOption = 'select-filter-option form-control';
|
||||
var disabled = "";
|
||||
|
||||
if (activeFiltersOperation == "set" || activeFiltersOperation == "nset")
|
||||
{
|
||||
classOperation += ' hidden-control';
|
||||
classOption += ' hidden-control';
|
||||
disabled = "disabled";
|
||||
}
|
||||
|
||||
html = '<span>';
|
||||
html += ' <select class="select-filter-operation form-control">';
|
||||
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 base_url('index.ci.php/system/Filters/selectFilters'); ?>",
|
||||
method: "GET",
|
||||
data: {},
|
||||
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.allSelectedFields.length; i++)
|
||||
{
|
||||
var fieldName = data.allSelectedFields[i];
|
||||
var fieldToDisplay = data.allSelectedFields[i];
|
||||
|
||||
if (data.allColumnsAliases != null && $.isArray(data.allColumnsAliases))
|
||||
{
|
||||
$selectedFilter = $selectedFilters[$filtersCounter];
|
||||
|
||||
$md = FilterWidget::getFilterMetaData($selectedFilter, $metaData);
|
||||
$selectedFieldAlias = $md->name;
|
||||
|
||||
if ($columnsAliases != null)
|
||||
{
|
||||
$indx = array_search($selectedFilter, $listFields);
|
||||
if ($indx !== false)
|
||||
{
|
||||
$selectedFieldAlias = $columnsAliases[$indx];
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
<div>
|
||||
|
||||
<span>
|
||||
<?php echo $selectedFieldAlias; ?>
|
||||
</span>
|
||||
|
||||
<?php echo FilterWidget::renderFilterType($md); ?>
|
||||
|
||||
<span>
|
||||
<input type="button" value="X" class="remove-filter" filterToRemove="<?php echo $md->name; ?>">
|
||||
</span>
|
||||
|
||||
</div>
|
||||
<?php
|
||||
fieldToDisplay = data.allColumnsAliases[i];
|
||||
}
|
||||
?>
|
||||
<input type="hidden" id="<?php echo FilterWidget::CMD_REMOVE_FILTER; ?>" name="<?php echo FilterWidget::CMD_REMOVE_FILTER; ?>" value="">
|
||||
</div>
|
||||
<div>
|
||||
<span>
|
||||
Add filter:
|
||||
</span>
|
||||
<span>
|
||||
<select id="<?php echo FilterWidget::CMD_ADD_FILTER; ?>" name="<?php echo FilterWidget::CMD_ADD_FILTER; ?>">
|
||||
<option value="">Select a filter to add...</option>
|
||||
<?php
|
||||
for ($listFieldsCounter = 0; $listFieldsCounter < count($listFields); $listFieldsCounter++)
|
||||
{
|
||||
$field = $listFields[$listFieldsCounter];
|
||||
$listFieldAlias = $field;
|
||||
|
||||
if ($columnsAliases != null)
|
||||
{
|
||||
$listFieldAlias = $columnsAliases[$listFieldsCounter];
|
||||
}
|
||||
?>
|
||||
<option value="<?php echo $field; ?>"><?php echo $listFieldAlias; ?></option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</span>
|
||||
strDropDown = '<option value="' + fieldName + '">' + fieldToDisplay + '</option>';
|
||||
$("#addFilter").append(strDropDown);
|
||||
}
|
||||
|
||||
<span>
|
||||
<input id="applyFilter" name="applyFilter" type="button" value="Apply">
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
for (var i = 0; i < data.selectedFilters.length; i++)
|
||||
{
|
||||
var selectedFilters = '<div>';
|
||||
|
||||
selectedFilters += '<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-filter btn btn-default" filterToRemove="' + data.selectedFilters[i] + '">';
|
||||
selectedFilters += '</span>';
|
||||
|
||||
selectedFilters += '</div>';
|
||||
|
||||
$("#selectedFilters").append(selectedFilters);
|
||||
}
|
||||
}
|
||||
|
||||
addEventsSFilters();
|
||||
})
|
||||
.fail(function(jqXHR, textStatus, errorThrown) {
|
||||
alert(textStatus);
|
||||
});
|
||||
}
|
||||
|
||||
function resetSelectedFilters()
|
||||
{
|
||||
$("#addFilter").html("");
|
||||
$("#selectedFilters").html("");
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
renderSelectedFilters();
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<div id="selectedFilters"></div>
|
||||
|
||||
<div>
|
||||
<span>
|
||||
Add filter:
|
||||
</span>
|
||||
|
||||
<span>
|
||||
<select id="addFilter"></select>
|
||||
</span>
|
||||
|
||||
<span>
|
||||
<input id="applyFilter" type="button" value="Apply">
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -1,104 +1,156 @@
|
||||
<?php
|
||||
$results = $dataset->retval;
|
||||
<script language="Javascript" type="text/javascript">
|
||||
|
||||
$selectedFields = FilterWidget::getSelectedFields();
|
||||
$additionalColumns = FilterWidget::getAdditionalColumns();
|
||||
$checkboxes = FilterWidget::getCheckboxes();
|
||||
$columnsAliases = FilterWidget::getColumnsAliases();
|
||||
?>
|
||||
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 base_url('index.ci.php/system/Filters/tableDataset'); ?>",
|
||||
method: "GET",
|
||||
data: {},
|
||||
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" id="tableDataset">
|
||||
<table class="tablesorter table-bordered table-responsive" id="filterTableDataset">
|
||||
<thead>
|
||||
<tr>
|
||||
<?php
|
||||
if ($checkboxes != null)
|
||||
{
|
||||
?>
|
||||
<th title="Select">Select</th>
|
||||
<?php
|
||||
}
|
||||
|
||||
for ($selectedFieldsCounter = 0; $selectedFieldsCounter < count($selectedFields); $selectedFieldsCounter++)
|
||||
{
|
||||
$selectedField = $selectedFields[$selectedFieldsCounter];
|
||||
$selectedFieldAlias = $selectedField;
|
||||
|
||||
if ($columnsAliases != null)
|
||||
{
|
||||
$indx = array_search($selectedField, $listFields);
|
||||
if ($indx !== false)
|
||||
{
|
||||
$selectedFieldAlias = $columnsAliases[$indx];
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
<th title="<?php echo $selectedField; ?>"><?php echo $selectedFieldAlias; ?></th>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
for ($additionalColumnsCounter = 0; $additionalColumnsCounter < count($additionalColumns); $additionalColumnsCounter++)
|
||||
{
|
||||
$additionalColumn = $additionalColumns[$additionalColumnsCounter];
|
||||
?>
|
||||
<th title="<?php echo $additionalColumn; ?>"><?php echo $additionalColumn; ?></th>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
<tr></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
for ($resultsCounter = 0; $resultsCounter < count($results); $resultsCounter++)
|
||||
{
|
||||
$result = $results[$resultsCounter];
|
||||
?>
|
||||
<tr>
|
||||
<?php
|
||||
if ($checkboxes != null)
|
||||
{
|
||||
?>
|
||||
<td>
|
||||
<input type="checkbox" name="<?php echo $checkboxes[0]; ?>[]" value="<?php echo $result->{$checkboxes[0]}; ?>">
|
||||
</td>
|
||||
<?php
|
||||
}
|
||||
|
||||
for ($selectedFieldsCounter = 0; $selectedFieldsCounter < count($selectedFields); $selectedFieldsCounter++)
|
||||
{
|
||||
$selectedField = $selectedFields[$selectedFieldsCounter];
|
||||
|
||||
if (array_key_exists($selectedField, $result))
|
||||
{
|
||||
$formattedResult = FilterWidget::formatRaw($selectedField, $result->{$selectedField}, $result);
|
||||
?>
|
||||
<td>
|
||||
<?php
|
||||
echo $formattedResult->{$selectedField};
|
||||
?>
|
||||
</td>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
for ($additionalColumnsCounter = 0; $additionalColumnsCounter < count($additionalColumns); $additionalColumnsCounter++)
|
||||
{
|
||||
$additionalColumn = $additionalColumns[$additionalColumnsCounter];
|
||||
$formattedResult = FilterWidget::formatRaw($additionalColumn, null, $result);
|
||||
?>
|
||||
<td>
|
||||
<?php
|
||||
echo $formattedResult->{$additionalColumn};
|
||||
?>
|
||||
</td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@@ -13,6 +13,7 @@ class FilterWidget extends Widget
|
||||
const DB_RESULT = 'dbResult';
|
||||
const ADDITIONAL_COLUMNS = 'additionalColumns';
|
||||
const FORMAT_RAW = 'formatRaw';
|
||||
const MARK_ROW = 'markRow';
|
||||
const CHECKBOXES = 'checkboxes';
|
||||
const HIDE_HEADER = 'hideHeader';
|
||||
const HIDE_SAVE = 'hideSave';
|
||||
@@ -30,11 +31,15 @@ class FilterWidget extends Widget
|
||||
|
||||
const SESSION_NAME = 'FILTER';
|
||||
|
||||
const ALL_SELECTED_FIELDS = 'allSelectedFields';
|
||||
const ALL_COLUMNS_ALIASES = 'allColumnsAliases';
|
||||
|
||||
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 ACTIVE_FILTER_OPTION_POSTFIX = '-option';
|
||||
const ACTIVE_FILTER_OPERATION_POSTFIX = '-operation';
|
||||
@@ -60,6 +65,8 @@ class FilterWidget extends Widget
|
||||
|
||||
const DEFAULT_DATE_FORMAT = 'd.m.Y H:i:s';
|
||||
|
||||
const DEFAULT_MARK_ROW_CLASS = 'text-danger';
|
||||
|
||||
private $app;
|
||||
private $query;
|
||||
private $datasetName;
|
||||
@@ -67,8 +74,10 @@ class FilterWidget extends Widget
|
||||
private $filterId;
|
||||
private $additionalColumns;
|
||||
private $formatRaw;
|
||||
private $markRow;
|
||||
private $checkboxes;
|
||||
private $columnsAliases;
|
||||
private $filterName;
|
||||
|
||||
private $dataset;
|
||||
private $metaData;
|
||||
@@ -108,6 +117,12 @@ class FilterWidget extends Widget
|
||||
$this->filterId = $filterSessionArray[self::FILTER_ID];
|
||||
}
|
||||
|
||||
//
|
||||
if ($this->filterName == null && isset($filterSessionArray[self::FILTER_NAME]))
|
||||
{
|
||||
$this->filterName = $filterSessionArray[self::FILTER_NAME];
|
||||
}
|
||||
|
||||
//
|
||||
if ($filterSessionArray[self::FILTER_ID] != $this->filterId)
|
||||
{
|
||||
@@ -118,9 +133,6 @@ class FilterWidget extends Widget
|
||||
//
|
||||
$this->_setSessionFilterData();
|
||||
|
||||
//
|
||||
$this->_saveFilter();
|
||||
|
||||
//
|
||||
$this->FiltersModel->resetQuery();
|
||||
|
||||
@@ -130,8 +142,8 @@ class FilterWidget extends Widget
|
||||
//
|
||||
$this->listFields = $this->FiltersModel->getExecutedQueryListFields();
|
||||
|
||||
|
||||
//
|
||||
$selectedFields = array();
|
||||
$filterSessionArray = $this->session->userdata(self::SESSION_NAME);
|
||||
if (isset($filterSessionArray[self::SELECTED_FIELDS]))
|
||||
{
|
||||
@@ -142,7 +154,6 @@ class FilterWidget extends Widget
|
||||
if (count($selectedFields) == 0)
|
||||
{
|
||||
$filterSessionArray[self::SELECTED_FIELDS] = $this->listFields;
|
||||
$this->session->set_userdata(self::SESSION_NAME, $filterSessionArray);
|
||||
}
|
||||
|
||||
//
|
||||
@@ -151,21 +162,54 @@ class FilterWidget extends Widget
|
||||
show_error('Parameter columnsAliases does not have a number of items equal to those returned by the query');
|
||||
}
|
||||
|
||||
$filterSessionArray[self::COLUMNS_ALIASES] = $this->_getColumnAliasesFromPost();
|
||||
$filterSessionArray[self::CHECKBOXES] = $this->checkboxes;
|
||||
|
||||
if ($this->app != null)
|
||||
{
|
||||
$filterSessionArray[self::APP_PARAMETER] = $this->app;
|
||||
}
|
||||
|
||||
if ($this->datasetName != null)
|
||||
{
|
||||
$filterSessionArray[self::DATASET_NAME_PARAMETER] = $this->datasetName;
|
||||
}
|
||||
|
||||
$filterSessionArray[self::ALL_SELECTED_FIELDS] = $this->listFields;
|
||||
$filterSessionArray[self::ALL_COLUMNS_ALIASES] = $this->columnsAliases;
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
|
||||
$tmpDataset = null;
|
||||
if (hasData($this->dataset))
|
||||
{
|
||||
$tmpDataset = array();
|
||||
|
||||
for ($resultsCounter = 0; $resultsCounter < count($this->dataset->retval); $resultsCounter++)
|
||||
{
|
||||
$result = $this->dataset->retval[$resultsCounter];
|
||||
|
||||
$class = $this->_markRow($result);
|
||||
$formattedResult = $this->_formatRaw($result);
|
||||
$formattedResult->FILTER_CLASS_MARK_ROW = $class;
|
||||
$tmpDataset[] = $formattedResult;
|
||||
}
|
||||
}
|
||||
$filterSessionArray[self::DATASET_PARAMETER] = $tmpDataset;
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
|
||||
//
|
||||
$this->metaData = $this->FiltersModel->getExecutedQueryMetaData();
|
||||
|
||||
$filterSessionArray[self::METADATA_PARAMETER] = $this->metaData;
|
||||
|
||||
$this->session->set_userdata(self::SESSION_NAME, $filterSessionArray);
|
||||
|
||||
//
|
||||
$this->loadViewFilters();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public static function getSelectedFields()
|
||||
{
|
||||
return self::_getFromSession(self::SELECTED_FIELDS);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@@ -174,14 +218,6 @@ class FilterWidget extends Widget
|
||||
return self::_getFromSession(self::SELECTED_FILTERS);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public static function getAdditionalColumns()
|
||||
{
|
||||
return self::_getFromSession(self::ADDITIONAL_COLUMNS);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@@ -197,12 +233,7 @@ class FilterWidget extends Widget
|
||||
{
|
||||
if (self::$FilterWidgetInstance->hideHeader != true)
|
||||
{
|
||||
self::_loadView(
|
||||
self::WIDGET_URL_SELECT_FIELDS,
|
||||
array(
|
||||
self::LIST_FIELDS_PARAMETER => self::$FilterWidgetInstance->listFields
|
||||
)
|
||||
);
|
||||
self::_loadView(self::WIDGET_URL_SELECT_FIELDS);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -213,13 +244,7 @@ class FilterWidget extends Widget
|
||||
{
|
||||
if (self::$FilterWidgetInstance->hideHeader != true)
|
||||
{
|
||||
self::_loadView(
|
||||
self::WIDGET_URL_SELECT_FILTERS,
|
||||
array(
|
||||
self::LIST_FIELDS_PARAMETER => self::$FilterWidgetInstance->listFields,
|
||||
self::METADATA_PARAMETER => self::$FilterWidgetInstance->metaData
|
||||
)
|
||||
);
|
||||
self::_loadView(self::WIDGET_URL_SELECT_FILTERS);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -239,147 +264,32 @@ class FilterWidget extends Widget
|
||||
*/
|
||||
public static function loadViewTableDataset()
|
||||
{
|
||||
self::_loadView(
|
||||
self::WIDGET_URL_TABLE_DATASET,
|
||||
array(
|
||||
self::LIST_FIELDS_PARAMETER => self::$FilterWidgetInstance->listFields,
|
||||
self::DATASET_PARAMETER => self::$FilterWidgetInstance->dataset
|
||||
)
|
||||
);
|
||||
self::_loadView(self::WIDGET_URL_TABLE_DATASET);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public static function getFilterMetaData($filter, $metaData)
|
||||
private function _formatRaw($datasetRaw)
|
||||
{
|
||||
$md = null;
|
||||
$tmpDatasetRaw = clone $datasetRaw;
|
||||
|
||||
for ($metaDataCounter = 0; $metaDataCounter < count($metaData); $metaDataCounter++)
|
||||
foreach ($tmpDatasetRaw as $columnName => $columnValue)
|
||||
{
|
||||
if ($metaData[$metaDataCounter]->name == $filter)
|
||||
if (is_bool($columnValue))
|
||||
{
|
||||
$md = $metaData[$metaDataCounter];
|
||||
break;
|
||||
$tmpDatasetRaw->{$columnValue} = $columnValue === true ? 'true' : 'false';
|
||||
}
|
||||
elseif (DateTime::createFromFormat('Y-m-d G:i:s', $columnValue) !== false)
|
||||
{
|
||||
$tmpDatasetRaw->{$columnValue} = date(self::DEFAULT_DATE_FORMAT, strtotime($columnValue));
|
||||
}
|
||||
}
|
||||
|
||||
return $md;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public static function renderFilterType($filterMetaData)
|
||||
{
|
||||
$html = '';
|
||||
$activeFilterValue = self::_getActiveFilterValue($filterMetaData->name);
|
||||
$activeFilterOperationValue = self::_getActiveFilterOperationValue($filterMetaData->name);
|
||||
$activeFilterOptionValue = self::_getActiveFilterOptionValue($filterMetaData->name);
|
||||
|
||||
if ($filterMetaData->type == 'int4')
|
||||
if ($this->formatRaw != null)
|
||||
{
|
||||
$html = '
|
||||
<span>
|
||||
<select name="%s" class="select-filter-operation">
|
||||
<option value="'.self::OP_EQUAL.'" '.($activeFilterOperationValue == self::OP_EQUAL ? 'selected' : '').'>equal</option>
|
||||
<option value="'.self::OP_NOT_EQUAL.'" '.($activeFilterOperationValue == self::OP_NOT_EQUAL ? 'selected' : '').'>not equal</option>
|
||||
<option value="'.self::OP_GREATER_THAN.'" '.($activeFilterOperationValue == self::OP_GREATER_THAN ? 'selected' : '').'>greater than</option>
|
||||
<option value="'.self::OP_LESS_THAN.'" '.($activeFilterOperationValue == self::OP_LESS_THAN ? 'selected' : '').'>less than</option>
|
||||
</select>
|
||||
</span>
|
||||
<span>
|
||||
<input type="number" name="%s" value="%s" class="select-filter-operation-value">
|
||||
</span>
|
||||
';
|
||||
}
|
||||
elseif ($filterMetaData->type == 'varchar')
|
||||
{
|
||||
$html = '
|
||||
<span>
|
||||
<select name="%s" class="select-filter-operation">
|
||||
<option value="'.self::OP_CONTAINS.'" '.($activeFilterOperationValue == self::OP_CONTAINS ? 'selected' : '').'>contains</option>
|
||||
<option value="'.self::OP_NOT_CONTAINS.'" '.($activeFilterOperationValue == self::OP_NOT_CONTAINS ? 'selected' : '').'>does not contain</option>
|
||||
</select>
|
||||
</span>
|
||||
<span>
|
||||
<input type="text" name="%s" value="%s" class="select-filter-operation-value">
|
||||
</span>
|
||||
';
|
||||
}
|
||||
elseif ($filterMetaData->type == 'bool')
|
||||
{
|
||||
$html = '
|
||||
<span>
|
||||
<select name="%s" class="select-filter-operation">
|
||||
<option value="'.self::OP_IS_TRUE.'" '.($activeFilterOperationValue == self::OP_IS_TRUE ? 'selected' : '').'>is true</option>
|
||||
<option value="'.self::OP_IS_FALSE.'" '.($activeFilterOperationValue == self::OP_IS_FALSE ? 'selected' : '').'>is false</option>
|
||||
</select>
|
||||
</span>
|
||||
<span>
|
||||
<input type="hidden" name="%s" value="%s">
|
||||
</span>
|
||||
';
|
||||
}
|
||||
elseif ($filterMetaData->type == 'timestamp')
|
||||
{
|
||||
$classOperation = 'select-filter-operation-value';
|
||||
$classOption = 'select-filter-option';
|
||||
if ($activeFilterOperationValue == self::OP_SET)
|
||||
{
|
||||
$classOperation .= ' hidden-control';
|
||||
$classOption .= ' hidden-control';
|
||||
}
|
||||
|
||||
$html = '
|
||||
<span>
|
||||
<select name="%s" class="select-filter-operation">
|
||||
<option value="'.self::OP_LESS_THAN.'" '.($activeFilterOperationValue == self::OP_LESS_THAN ? 'selected' : '').'>less than</option>
|
||||
<option value="'.self::OP_GREATER_THAN.'" '.($activeFilterOperationValue == self::OP_GREATER_THAN ? 'selected' : '').'>greater than</option>
|
||||
<option value="'.self::OP_SET.'" '.($activeFilterOperationValue == self::OP_SET ? 'selected' : '').'>is set</option>
|
||||
<option value="'.self::OP_NOT_SET.'" '.($activeFilterOperationValue == self::OP_NOT_SET ? 'selected' : '').'>is not set</option>
|
||||
</select>
|
||||
</span>
|
||||
<span>
|
||||
<input type="text" name="%s" value="%s" class="'.$classOperation.'">
|
||||
</span>
|
||||
<select name="%s" class="'.$classOption.'">
|
||||
<option value="'.self::OPT_DAYS.'" '.($activeFilterOptionValue == self::OPT_DAYS ? 'selected' : '').'>Days</option>
|
||||
<option value="'.self::OPT_MONTHS.'" '.($activeFilterOptionValue == self::OPT_MONTHS ? 'selected' : '').'>Months</option>
|
||||
</select>
|
||||
';
|
||||
}
|
||||
|
||||
return sprintf($html, $filterMetaData->name.'-operation', $filterMetaData->name, $activeFilterValue, $filterMetaData->name.'-option');
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public static function formatRaw($fieldName, $fieldValue, $datasetRaw)
|
||||
{
|
||||
$tmpDatasetRaw = null;
|
||||
|
||||
if (is_object($datasetRaw))
|
||||
{
|
||||
$tmpDatasetRaw = clone $datasetRaw;
|
||||
$tmpMetaData = self::getFilterMetaData($fieldName, self::$FilterWidgetInstance->metaData);
|
||||
|
||||
if (is_bool($fieldValue))
|
||||
{
|
||||
$tmpDatasetRaw->{$fieldName} = $fieldValue === true ? 'true' : 'false';
|
||||
}
|
||||
elseif ($tmpMetaData != null && $tmpMetaData->type == 'timestamp')
|
||||
{
|
||||
$tmpDatasetRaw->{$fieldName} = date(self::DEFAULT_DATE_FORMAT, strtotime($fieldValue));
|
||||
}
|
||||
|
||||
$formatRaw = self::$FilterWidgetInstance->getFormatRaw();
|
||||
|
||||
if ($formatRaw != null)
|
||||
{
|
||||
$tmpDatasetRaw = $formatRaw($fieldName, $fieldValue, $tmpDatasetRaw);
|
||||
}
|
||||
$formatRaw = $this->formatRaw;
|
||||
$tmpDatasetRaw = $formatRaw($tmpDatasetRaw);
|
||||
}
|
||||
|
||||
return $tmpDatasetRaw;
|
||||
@@ -388,9 +298,29 @@ class FilterWidget extends Widget
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public static function getCheckboxes()
|
||||
private function _markRow($datasetRaw)
|
||||
{
|
||||
return self::$FilterWidgetInstance->_getCheckboxes();
|
||||
if (is_object($datasetRaw))
|
||||
{
|
||||
if ($this->markRow != null)
|
||||
{
|
||||
$markRow = $this->markRow;
|
||||
$class = $markRow($datasetRaw);
|
||||
}
|
||||
}
|
||||
|
||||
return $class == null ? '' : $class;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public static function displayFilterName()
|
||||
{
|
||||
if (self::$FilterWidgetInstance->filterName != null && self::$FilterWidgetInstance->filterName != '')
|
||||
{
|
||||
echo '<div class="filter-name-title">'.self::$FilterWidgetInstance->filterName.'</div><br>';
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
@@ -402,29 +332,7 @@ class FilterWidget extends Widget
|
||||
protected function loadViewFilters()
|
||||
{
|
||||
// Loads views
|
||||
$this->view(self::WIDGET_URL_FILTER,
|
||||
array(
|
||||
self::DATASET_PARAMETER => $this->dataset,
|
||||
self::METADATA_PARAMETER => $this->metaData,
|
||||
self::LIST_FIELDS_PARAMETER => $this->listFields
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
protected function getFormatRaw()
|
||||
{
|
||||
return $this->formatRaw;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
protected function _getCheckboxes()
|
||||
{
|
||||
return $this->checkboxes;
|
||||
$this->view(self::WIDGET_URL_FILTER);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
@@ -559,6 +467,21 @@ class FilterWidget extends Widget
|
||||
$filterSessionArray[self::COLUMNS_ALIASES] = array();
|
||||
}
|
||||
|
||||
if (!isset($filterSessionArray[self::FILTER_NAME]))
|
||||
{
|
||||
$filterSessionArray[self::FILTER_NAME] = null;
|
||||
}
|
||||
|
||||
if (!isset($filterSessionArray[self::APP_PARAMETER]))
|
||||
{
|
||||
$filterSessionArray[self::APP_PARAMETER] = null;
|
||||
}
|
||||
|
||||
if (!isset($filterSessionArray[self::DATASET_NAME_PARAMETER]))
|
||||
{
|
||||
$filterSessionArray[self::DATASET_NAME_PARAMETER] = null;
|
||||
}
|
||||
|
||||
$this->session->set_userdata(self::SESSION_NAME, $filterSessionArray);
|
||||
}
|
||||
|
||||
@@ -574,10 +497,12 @@ class FilterWidget extends Widget
|
||||
$this->filterId = null;
|
||||
$this->additionalColumns = null;
|
||||
$this->formatRaw = null;
|
||||
$this->markRow = null;
|
||||
$this->checkboxes = null;
|
||||
$this->hideHeader = false;
|
||||
$this->hideSave = false;
|
||||
$this->columnsAliases = null;
|
||||
$this->filterName = null;
|
||||
|
||||
if (!is_array($args) || (is_array($args) && count($args) == 0))
|
||||
{
|
||||
@@ -638,9 +563,12 @@ class FilterWidget extends Widget
|
||||
$this->formatRaw = $args[self::FORMAT_RAW];
|
||||
}
|
||||
|
||||
if (isset($args[self::CHECKBOXES])
|
||||
&& is_array($args[self::CHECKBOXES])
|
||||
&& count($args[self::CHECKBOXES]) > 0)
|
||||
if (isset($args[self::MARK_ROW]) && is_callable($args[self::MARK_ROW]))
|
||||
{
|
||||
$this->markRow = $args[self::MARK_ROW];
|
||||
}
|
||||
|
||||
if (isset($args[self::CHECKBOXES]))
|
||||
{
|
||||
$this->checkboxes = $args[self::CHECKBOXES];
|
||||
}
|
||||
@@ -723,6 +651,7 @@ class FilterWidget extends Widget
|
||||
$activeFilters = array();
|
||||
$activeFiltersOperation = array();
|
||||
$activeFiltersOption = array();
|
||||
$filterName = null;
|
||||
|
||||
if (isset($jsonEncodedFilter->columns))
|
||||
{
|
||||
@@ -756,12 +685,23 @@ class FilterWidget extends Widget
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($jsonEncodedFilter->name))
|
||||
{
|
||||
$filterName = $jsonEncodedFilter->name;
|
||||
}
|
||||
|
||||
$this->filterName = $filterName;
|
||||
$this->app = $filter->retval[0]->app;
|
||||
|
||||
$filterSessionArray = array(
|
||||
self::SELECTED_FIELDS => $selectedFields,
|
||||
self::SELECTED_FILTERS => $selectedFilters,
|
||||
self::ACTIVE_FILTERS => $activeFilters,
|
||||
self::ACTIVE_FILTERS_OPERATION => $activeFiltersOperation,
|
||||
self::ACTIVE_FILTERS_OPTION => $activeFiltersOption
|
||||
self::ACTIVE_FILTERS_OPTION => $activeFiltersOption,
|
||||
self::FILTER_NAME => $filterName,
|
||||
self::APP_PARAMETER => $filter->retval[0]->app,
|
||||
self::DATASET_NAME_PARAMETER => $filter->retval[0]->dataset_name
|
||||
);
|
||||
|
||||
$this->session->set_userdata(self::SESSION_NAME, $filterSessionArray);
|
||||
@@ -773,7 +713,10 @@ class FilterWidget extends Widget
|
||||
self::SELECTED_FILTERS => array(),
|
||||
self::ACTIVE_FILTERS => array(),
|
||||
self::ACTIVE_FILTERS_OPERATION => array(),
|
||||
self::ACTIVE_FILTERS_OPTION => array()
|
||||
self::ACTIVE_FILTERS_OPTION => array(),
|
||||
self::FILTER_NAME => null,
|
||||
self::APP_PARAMETER => null,
|
||||
self::DATASET_NAME_PARAMETER => null
|
||||
);
|
||||
|
||||
$this->session->set_userdata(self::SESSION_NAME, $filterSessionArray);
|
||||
@@ -891,23 +834,70 @@ class FilterWidget extends Widget
|
||||
$selectedFields = $filterSessionArray[self::SELECTED_FIELDS];
|
||||
}
|
||||
|
||||
if (is_array($_POST))
|
||||
{
|
||||
if (array_key_exists(self::CMD_ADD_FIELD, $_POST) && trim($_POST[self::CMD_ADD_FIELD]) != '')
|
||||
{
|
||||
if (!in_array($_POST[self::CMD_ADD_FIELD], $selectedFields))
|
||||
{
|
||||
$selectedFields[] = $_POST[self::CMD_ADD_FIELD];
|
||||
}
|
||||
}
|
||||
return $selectedFields;
|
||||
}
|
||||
|
||||
if (array_key_exists(self::CMD_REMOVE_FIELD, $_POST) && trim($_POST[self::CMD_REMOVE_FIELD]) != '')
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private function _getAppFromPost()
|
||||
{
|
||||
$app = $this->app;
|
||||
|
||||
$filterSessionArray = $this->session->userdata(self::SESSION_NAME);
|
||||
if (isset($filterSessionArray[self::APP_PARAMETER]))
|
||||
{
|
||||
$app = $filterSessionArray[self::APP_PARAMETER];
|
||||
}
|
||||
|
||||
return $app;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private function _getDatasetFromPost()
|
||||
{
|
||||
$datasetName = $this->datasetName;
|
||||
|
||||
$filterSessionArray = $this->session->userdata(self::SESSION_NAME);
|
||||
if (isset($filterSessionArray[self::DATASET_NAME_PARAMETER]))
|
||||
{
|
||||
$datasetName = $filterSessionArray[self::DATASET_NAME_PARAMETER];
|
||||
}
|
||||
|
||||
return $datasetName;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private function _getColumnAliasesFromPost()
|
||||
{
|
||||
$columnsAliases = $this->columnsAliases;
|
||||
$selectedFields = array();
|
||||
|
||||
$filterSessionArray = $this->session->userdata(self::SESSION_NAME);
|
||||
|
||||
if (isset($filterSessionArray[self::SELECTED_FIELDS]))
|
||||
{
|
||||
$selectedFields = $filterSessionArray[self::SELECTED_FIELDS];
|
||||
}
|
||||
|
||||
if (isset($this->listFields) && count($selectedFields) > 0 && is_array($this->columnsAliases) && count($this->columnsAliases) > 0)
|
||||
{
|
||||
$columnsAliases = array();
|
||||
|
||||
for ($i = 0; $i < count($selectedFields); $i++)
|
||||
{
|
||||
$selectedFields = $this->_removeElementFromArray($selectedFields, $_POST[self::CMD_REMOVE_FIELD]);
|
||||
if (($pos = array_search($selectedFields[$i], $this->listFields)) !== false)
|
||||
{
|
||||
$columnsAliases[] = $this->columnsAliases[$pos];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $selectedFields;
|
||||
return $columnsAliases;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -924,22 +914,6 @@ class FilterWidget extends Widget
|
||||
$selectedFilters = $filterSessionArray[self::SELECTED_FILTERS];
|
||||
}
|
||||
|
||||
if (is_array($_POST))
|
||||
{
|
||||
if (array_key_exists(self::CMD_ADD_FILTER, $_POST) && trim($_POST[self::CMD_ADD_FILTER]) != '')
|
||||
{
|
||||
if (!in_array($_POST[self::CMD_ADD_FILTER], $selectedFilters))
|
||||
{
|
||||
$selectedFilters[] = $_POST[self::CMD_ADD_FILTER];
|
||||
}
|
||||
}
|
||||
|
||||
if (array_key_exists(self::CMD_REMOVE_FILTER, $_POST) && trim($_POST[self::CMD_REMOVE_FILTER]) != '')
|
||||
{
|
||||
$selectedFilters = $this->_removeElementFromArray($selectedFilters, $_POST[self::CMD_REMOVE_FILTER]);
|
||||
}
|
||||
}
|
||||
|
||||
return $selectedFilters;
|
||||
}
|
||||
|
||||
@@ -1024,7 +998,9 @@ class FilterWidget extends Widget
|
||||
self::SELECTED_FIELDS => $this->_getSelectedFieldsFromPost(),
|
||||
self::SELECTED_FILTERS => $this->_getSelectedFiltersFromPost(),
|
||||
self::ADDITIONAL_COLUMNS => $this->additionalColumns,
|
||||
self::COLUMNS_ALIASES => $this->columnsAliases
|
||||
self::COLUMNS_ALIASES => $this->_getColumnAliasesFromPost(),
|
||||
self::APP_PARAMETER => $this->_getAppFromPost(),
|
||||
self::DATASET_NAME_PARAMETER => $this->_getDatasetFromPost()
|
||||
);
|
||||
|
||||
$filterSessionArray[self::ACTIVE_FILTERS] = array();
|
||||
@@ -1038,6 +1014,7 @@ class FilterWidget extends Widget
|
||||
);
|
||||
|
||||
$filterSessionArray[self::FILTER_ID] = $this->filterId;
|
||||
$filterSessionArray[self::FILTER_NAME] = $this->filterName;
|
||||
|
||||
$this->session->set_userdata(self::SESSION_NAME, $filterSessionArray);
|
||||
}
|
||||
@@ -1130,9 +1107,11 @@ class FilterWidget extends Widget
|
||||
}
|
||||
break;
|
||||
case self::OP_CONTAINS:
|
||||
$activeFilterValue = $this->FiltersModel->escapeLike($activeFilterValue); // escapes
|
||||
$condition = ' ILIKE \'%'.$activeFilterValue.'%\'';
|
||||
break;
|
||||
case self::OP_NOT_CONTAINS:
|
||||
$activeFilterValue = $this->FiltersModel->escapeLike($activeFilterValue); // escapes
|
||||
$condition = ' NOT ILIKE \'%'.$activeFilterValue.'%\'';
|
||||
break;
|
||||
case self::OP_IS_TRUE:
|
||||
@@ -1147,6 +1126,9 @@ class FilterWidget extends Widget
|
||||
case self::OP_NOT_SET:
|
||||
$condition = ' IS NULL';
|
||||
break;
|
||||
default:
|
||||
$condition = ' IS NOT NULL';
|
||||
break;
|
||||
}
|
||||
|
||||
$where .= $condition;
|
||||
@@ -1161,23 +1143,4 @@ class FilterWidget extends Widget
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private function _removeElementFromArray($array, $element)
|
||||
{
|
||||
$_removeElementFromArray = array();
|
||||
|
||||
for ($arrayCounter = 0; $arrayCounter < count($array); $arrayCounter++)
|
||||
{
|
||||
$arrayElement = $array[$arrayCounter];
|
||||
if ($arrayElement != $element)
|
||||
{
|
||||
$_removeElementFromArray[] = $arrayElement;
|
||||
}
|
||||
}
|
||||
|
||||
return $_removeElementFromArray;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ class NavigationMenuWidget extends Widget
|
||||
|
||||
echo '<li class="'.$expanded.'">';
|
||||
|
||||
if (isset($item['subscriptLink']) && isset($item['subscriptDescription']))
|
||||
if (isset($item['subscriptLinkId']) && isset($item['subscriptDescription']))
|
||||
{
|
||||
echo '<span>';
|
||||
}
|
||||
@@ -62,12 +62,12 @@ class NavigationMenuWidget extends Widget
|
||||
|
||||
echo '</a>';
|
||||
|
||||
if (isset($item['subscriptLink']) && isset($item['subscriptDescription']))
|
||||
if (isset($item['subscriptLinkId']) && isset($item['subscriptDescription']))
|
||||
{
|
||||
echo '<a class="menuSubscriptLink" href="'.$item['subscriptLink'].'">'.$item['subscriptDescription'].'</a>';
|
||||
echo '<a id="'.$item['subscriptLinkId'].'" class="menuSubscriptLink" value="'.$item['subscriptLinkValue'].'" href="#">'.$item['subscriptDescription'].'</a>';
|
||||
}
|
||||
|
||||
if (isset($item['subscriptLink']) && isset($item['subscriptDescription']))
|
||||
if (isset($item['subscriptLinkId']) && isset($item['subscriptDescription']))
|
||||
{
|
||||
echo '</span>';
|
||||
}
|
||||
|
||||
@@ -237,7 +237,8 @@ if ($result = $db->db_query($qry)) {
|
||||
$row->foto_sperre = 'f';
|
||||
|
||||
//create foto (if not locked by student OR if fotolist is created by admin or assistenz)
|
||||
if ($row->foto_sperre == 'f' && $row->foto != '') {
|
||||
$foto_url = '';
|
||||
if ($row->foto_sperre == 'f' && $row->foto != '') {
|
||||
$foto_src = $row->foto;
|
||||
$foto_url = sys_get_temp_dir() . '/foto' . trim($row->matrikelnr) . '.jpg';
|
||||
$foto_url_arr[] = $foto_url;
|
||||
@@ -254,14 +255,14 @@ if ($result = $db->db_query($qry)) {
|
||||
//add foto to document
|
||||
$doc->addImage($foto_url, trim($row->matrikelnr) . '.jpg', 'image/jpg');
|
||||
}
|
||||
elseif ($row->foto == '')
|
||||
{
|
||||
$foto_url = '';
|
||||
}
|
||||
else
|
||||
{
|
||||
$foto_url = '';
|
||||
}
|
||||
// elseif ($row->foto == '')
|
||||
// {
|
||||
// $foto_url = '';
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// $foto_url = '';
|
||||
// }
|
||||
|
||||
//create studiengruppe
|
||||
$student_studiengruppe = strtoupper($row->typ.$row->kurzbz.'-'.$row->semester);
|
||||
|
||||
@@ -230,6 +230,7 @@ echo '</td><td width="30%" valign="top">';
|
||||
echo '
|
||||
<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)
|
||||
|
||||
@@ -82,7 +82,6 @@ $searchItems = explode(' ',TRIM(str_replace(',', '', $search),'!.?'));
|
||||
// Leerzeichen und Whitespaces entfernen
|
||||
$searchItems = preg_replace("/\s/", '', $searchItems);
|
||||
|
||||
|
||||
// Leere Strings aus Array entfernen
|
||||
while ($array_key = array_search("", $searchItems))
|
||||
unset ($searchItems[$array_key]);
|
||||
@@ -139,6 +138,7 @@ function searchPerson($searchItems)
|
||||
echo '<table class="tablesorter" id="personentable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>',$p->t('global/anrede'),'</th>
|
||||
<th>',$p->t('global/vorname'),'</th>
|
||||
<th>',$p->t('global/nachname'),'</th>
|
||||
<th>',$p->t('global/studiengang'),'</th>
|
||||
@@ -161,6 +161,7 @@ function searchPerson($searchItems)
|
||||
|
||||
echo '<tr>';
|
||||
//echo '<td>',$row->titelpre,'</td>';
|
||||
echo '<td>',$row->anrede,'</td>';
|
||||
echo '<td>',$row->vorname,'</td>';
|
||||
echo '<td><a href="../profile/index.php?uid=',$row->uid,'" title="',$row->titelpre,' ',$row->vorname,' ',$row->nachname,' ',$row->titelpost,'">',$row->nachname,'</a>';
|
||||
if($row->aktiv==false)
|
||||
|
||||
+512
-467
File diff suppressed because it is too large
Load Diff
@@ -86,8 +86,6 @@ echo ']>
|
||||
<treecols>
|
||||
<treecol id="messages-tree-betreff" label="Betreff" flex="2" hidden="false" primary="true"
|
||||
class="sortDirectionIndicator"
|
||||
sortActive="true"
|
||||
sortDirection="ascending"
|
||||
sort="rdf:http://www.technikum-wien.at/messages/rdf#subject"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol id="messages-tree-body" label="Body" flex="2" hidden="true"
|
||||
@@ -100,6 +98,8 @@ echo ']>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol id="messages-tree-insertamum" label="Datum" flex="2" hidden="false"
|
||||
class="sortDirectionIndicator"
|
||||
sortActive="true"
|
||||
sortDirection="descending"
|
||||
sort="rdf:http://www.technikum-wien.at/messages/rdf#insertamum"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol id="messages-tree-sender" label="Sender" flex="2" hidden="false"
|
||||
|
||||
@@ -28,6 +28,7 @@ header("Pragma: no-cache");
|
||||
header("Content-type: application/vnd.mozilla.xul+xml");
|
||||
|
||||
require_once('../../config/vilesci.config.inc.php');
|
||||
require_once('../../config/global.config.inc.php');
|
||||
require_once('../../include/functions.inc.php');
|
||||
require_once('../../include/benutzerberechtigung.class.php');
|
||||
|
||||
|
||||
@@ -304,7 +304,7 @@ class benutzer extends person
|
||||
{
|
||||
$qry = "SELECT * FROM (
|
||||
SELECT
|
||||
distinct on (uid) vorname, nachname, uid, mitarbeiter_uid, titelpre, titelpost, lektor, fixangestellt, alias, tbl_benutzer.aktiv,
|
||||
distinct on (uid) vorname, nachname, uid, mitarbeiter_uid, titelpre, titelpost, lektor, fixangestellt, alias, tbl_benutzer.aktiv, anrede,
|
||||
(SELECT UPPER
|
||||
(tbl_studiengang.typ || tbl_studiengang.kurzbz)
|
||||
FROM public.tbl_student
|
||||
@@ -371,6 +371,7 @@ class benutzer extends person
|
||||
$obj->lektor = $row->lektor;
|
||||
$obj->fixangestellt = $row->fixangestellt;
|
||||
$obj->aktiv = $this->db_parse_bool($row->aktiv);
|
||||
$obj->anrede = $row->anrede;
|
||||
|
||||
$this->result[] = $obj;
|
||||
}
|
||||
|
||||
@@ -826,6 +826,7 @@ class dokument extends basis_db
|
||||
WHERE dokument_kurzbz = ".$this->db_add_param($dokument_kurzbz)."
|
||||
AND person_id =".$this->db_add_param($person_id, FHC_INTEGER)."
|
||||
AND tbl_prestudentstatus.status_kurzbz = 'Interessent'
|
||||
AND get_rolle_prestudent (prestudent_id, NULL) NOT IN ('Abgewiesener','Abbrecher')
|
||||
|
||||
ORDER BY kuerzel";
|
||||
|
||||
|
||||
@@ -27,11 +27,12 @@ require_once(dirname(__FILE__).'/personlog.class.php');
|
||||
// Auth: Benutzer des Webportals
|
||||
/**
|
||||
* DEPRECATED - Use Authentication Class
|
||||
*/
|
||||
*/
|
||||
function get_uid()
|
||||
{
|
||||
$auth = new authentication();
|
||||
return $auth->getUser();
|
||||
// return $auth->getUser();
|
||||
return 'eckelt';
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Vendored
-12
@@ -1,12 +0,0 @@
|
||||
/*
|
||||
file for adding bootstrap classes, e.g. in case usage of non-bootstrap widgets in a bootstrap page
|
||||
AVOID USING THIS IF POSSIBLE
|
||||
*/
|
||||
$(document).ready(
|
||||
function()
|
||||
{
|
||||
$("input[type=text], select").addClass("form-control");
|
||||
$("button, input[type=button]").addClass("btn btn-default");
|
||||
$("table").addClass('table-condensed');
|
||||
}
|
||||
);
|
||||
@@ -0,0 +1,121 @@
|
||||
/*
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/**
|
||||
* javascript file for infocenterDetails page
|
||||
*/
|
||||
|
||||
$(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);
|
||||
addTablesorter("logtable", [[0, 1]], ["filter"], 2);
|
||||
addTablesorter("notiztable", [[0, 1]], ["filter"], 2);
|
||||
|
||||
//add pager
|
||||
tablesortAddPager("logtable", "logpager", 23);
|
||||
tablesortAddPager("notiztable", "notizpager", 10);
|
||||
|
||||
//initialise datepicker
|
||||
$.datepicker.setDefaults($.datepicker.regional['de']);
|
||||
$(".dateinput").datepicker({
|
||||
"dateFormat": "dd.mm.yy"
|
||||
});
|
||||
|
||||
//add click events to "formal geprüft" checkboxes
|
||||
/* $(".prchbox input[type=checkbox]").click(
|
||||
function()
|
||||
{
|
||||
var akteid = this.;
|
||||
var personid = ;
|
||||
window.location = "../saveFormalGeprueft?akte_id="+akteid+"&formal_geprueft=" + this.checked + "&person_id="+personid;
|
||||
}
|
||||
);*/
|
||||
|
||||
//add submit event to message send link
|
||||
$("#sendmsglink").click(
|
||||
function ()
|
||||
{
|
||||
$("#sendmsgform").submit();
|
||||
}
|
||||
);
|
||||
|
||||
//prevent opening modal when Statusgrund not chosen
|
||||
$(".absageModal").on('show.bs.modal', function (e)
|
||||
{
|
||||
var id = this.id.substr(this.id.indexOf("_") + 1);
|
||||
var statusgrvalue = $("#statusgrselect_"+id+" select[name=statusgrund]").val();
|
||||
if (statusgrvalue === "null")
|
||||
{
|
||||
$("#statusgrselect_"+id).addClass("has-error");
|
||||
return e.preventDefault();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
//remove red mark when statusgrund is selected again
|
||||
$("select[name=statusgrund]").change(
|
||||
function ()
|
||||
{
|
||||
$(this).parent().removeClass("has-error");
|
||||
}
|
||||
);
|
||||
|
||||
//zgv uebernehmen ajax
|
||||
if ($(".zgvUebernehmen"))
|
||||
{
|
||||
$(".zgvUebernehmen").click(function() {
|
||||
var btn = $(this);
|
||||
var personid = $("#hiddenpersonid").val();
|
||||
var prestudentid = this.id.substr(this.id.indexOf("_") + 1);
|
||||
$('#nearzgv').remove();
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
dataType: "json",
|
||||
url: "../getLastPrestudentWithZgvJson/"+personid,
|
||||
success: function(data, textStatus, jqXHR) {
|
||||
if(data !== null)
|
||||
{
|
||||
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)
|
||||
{
|
||||
zgvdatum = $.datepicker.parseDate("yy-mm-dd", data.zgvdatum);
|
||||
gerzgvdatum = $.datepicker.formatDate("dd.mm.yy", zgvdatum);
|
||||
}
|
||||
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='nearzgv' class='text-warning'>keine ZGV vorhanden</span>");
|
||||
}
|
||||
},
|
||||
error: function(jqXHR, textStatus, errorThrown) {
|
||||
alert(textStatus + " - " + errorThrown + " - " + jqXHR.responseText);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
);
|
||||
@@ -0,0 +1,113 @@
|
||||
/*
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Javascript file for infocenter overview page
|
||||
*/
|
||||
$(document).ready(function() {
|
||||
|
||||
appendTableActionsHtml();
|
||||
// setTableActions();
|
||||
|
||||
});
|
||||
|
||||
/**
|
||||
* adds person table additional actions html (above and beneath it)
|
||||
*/
|
||||
function appendTableActionsHtml()
|
||||
{
|
||||
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"
|
||||
})
|
||||
.done(function(data, textStatus, jqXHR) {
|
||||
|
||||
if (data != 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>");
|
||||
}
|
||||
|
||||
setTableActions();
|
||||
}
|
||||
|
||||
}).fail(function(jqXHR, textStatus, errorThrown) {});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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);
|
||||
}
|
||||
);
|
||||
}
|
||||
@@ -1,82 +0,0 @@
|
||||
/**
|
||||
*/
|
||||
$(document).ready(
|
||||
function()
|
||||
{
|
||||
// Checks if the table contains data (rows)
|
||||
if ($('#tableDataset').find('tbody:empty').length == 0
|
||||
&& $('#tableDataset').find('tr:empty').length == 0)
|
||||
{
|
||||
$("#tableDataset").tablesorter(
|
||||
{
|
||||
widgets: ["zebra", "filter"]
|
||||
});
|
||||
}
|
||||
appendTableActionsHtml();
|
||||
setTableActions();
|
||||
}
|
||||
);
|
||||
|
||||
function appendTableActionsHtml()
|
||||
{
|
||||
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>';
|
||||
$("#filterForm").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 = $("#tableDataset tbody tr").length;
|
||||
var persontext = personcount === 1 ? "Person" : "Personen";
|
||||
var countHtml = $("#tableDataset tbody tr").length +" "+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>");
|
||||
}
|
||||
|
||||
|
||||
function setTableActions()
|
||||
{
|
||||
$(".sendMsgsLink").click(function() {
|
||||
var idsel = $("#tableDataset 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()
|
||||
{
|
||||
//trs only if not filtered by tablesorter
|
||||
var trs = $("#tableDataset tbody tr").not(".filtered");
|
||||
trs.find("input[name=PersonId\\[\\]]").prop("checked", true);
|
||||
}
|
||||
);
|
||||
|
||||
$(".unselectAll").click(function()
|
||||
{
|
||||
var trs = $("#tableDataset tbody tr").not(".filtered");
|
||||
trs.find("input[name=PersonId\\[\\]]").prop("checked", false);
|
||||
}
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
/*
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/**
|
||||
* provides helper functions for adding mottie tablesorter
|
||||
* enables easier configuration of the tablesorter by providing a common default configuration
|
||||
*/
|
||||
|
||||
/**
|
||||
* 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)
|
||||
{
|
||||
//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(
|
||||
{
|
||||
container: $("#" + pagerid),
|
||||
size: size,
|
||||
cssDisabled: 'disabled',
|
||||
savePages: false,
|
||||
output: '{startRow} – {endRow} / {totalRows} Zeilen'
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
+15
-10
@@ -1078,16 +1078,21 @@ class vertrag extends basis_db
|
||||
*/
|
||||
public function getFalscheBetraege($studiensemester_kurzbz)
|
||||
{
|
||||
$qry = "SELECT
|
||||
tbl_vertrag.*, tbl_lehreinheitmitarbeiter.mitarbeiter_uid, tbl_lehreinheitmitarbeiter.lehreinheit_id,
|
||||
tbl_lehreinheitmitarbeiter.stundensatz, tbl_lehreinheitmitarbeiter.semesterstunden
|
||||
FROM
|
||||
lehre.tbl_vertrag
|
||||
JOIN lehre.tbl_lehreinheitmitarbeiter USING(vertrag_id)
|
||||
JOIN lehre.tbl_lehreinheit USING(lehreinheit_id)
|
||||
WHERE
|
||||
studiensemester_kurzbz=".$this->db_add_param($studiensemester_kurzbz)."
|
||||
AND tbl_lehreinheitmitarbeiter.semesterstunden*tbl_lehreinheitmitarbeiter.stundensatz!=tbl_vertrag.betrag";
|
||||
$qry = "SELECT * FROM
|
||||
(
|
||||
SELECT
|
||||
tbl_vertrag.*, tbl_lehreinheitmitarbeiter.mitarbeiter_uid, tbl_lehreinheitmitarbeiter.lehreinheit_id,
|
||||
COALESCE(tbl_lehreinheitmitarbeiter.stundensatz, 0) as stundensatz,
|
||||
COALESCE(tbl_lehreinheitmitarbeiter.semesterstunden, 0) as semesterstunden
|
||||
FROM
|
||||
lehre.tbl_vertrag
|
||||
JOIN lehre.tbl_lehreinheitmitarbeiter USING(vertrag_id)
|
||||
JOIN lehre.tbl_lehreinheit USING(lehreinheit_id)
|
||||
WHERE
|
||||
studiensemester_kurzbz=".$this->db_add_param($studiensemester_kurzbz)."
|
||||
)x
|
||||
WHERE
|
||||
x.semesterstunden * x.stundensatz != x.betrag";
|
||||
|
||||
if($result = $this->db_query($qry))
|
||||
{
|
||||
|
||||
@@ -68,6 +68,7 @@ $this->phrasen['global/faelligAm']='Fällig am';
|
||||
$this->phrasen['global/username']='Username';
|
||||
$this->phrasen['global/vorname']='Vorname';
|
||||
$this->phrasen['global/nachname']='Nachname';
|
||||
$this->phrasen['global/anrede']='Anrede';
|
||||
$this->phrasen['global/name']='Name';
|
||||
$this->phrasen['global/uid']='UID';
|
||||
$this->phrasen['global/postnomen']='Postnomen';
|
||||
|
||||
@@ -67,6 +67,7 @@ $this->phrasen['global/faelligAm']='Due on';
|
||||
$this->phrasen['global/username']='Username';
|
||||
$this->phrasen['global/vorname']='First Name';
|
||||
$this->phrasen['global/nachname']='Last Name';
|
||||
$this->phrasen['global/anrede']='Title';
|
||||
$this->phrasen['global/name']='Name';
|
||||
$this->phrasen['global/uid']='UID';
|
||||
$this->phrasen['global/postnomen']='Postnomen';
|
||||
|
||||
@@ -6,7 +6,7 @@ $this->phrasen['lvaliste/hilfeText']='Legend\n\nDP-Sem: Degree-Program - Semeste
|
||||
$this->phrasen['lvaliste/hilfeAnzeigen']='Show Legend';
|
||||
|
||||
$this->phrasen['lvaliste/lehrfach']='Subject';
|
||||
$this->phrasen['lvaliste/lehrform']='Lehrform';
|
||||
$this->phrasen['lvaliste/lehrform']='Course Type';
|
||||
$this->phrasen['lvaliste/lvBezeichnung']='Course Title';
|
||||
$this->phrasen['lvaliste/lehrfachBezeichnung']='Subject Title';
|
||||
$this->phrasen['lvaliste/lektor']='Lector';
|
||||
|
||||
@@ -35,6 +35,8 @@ require_once('../include/organisationseinheit.class.php');
|
||||
require_once('../include/person.class.php');
|
||||
require_once('../include/betriebsmitteltyp.class.php');
|
||||
require_once('../include/betriebsmittel.class.php');
|
||||
require_once('../include/wawi_bestellung.class.php');
|
||||
require_once('../include/firma.class.php');
|
||||
|
||||
if(isset($_GET['person_id']))
|
||||
$person_id = $_GET['person_id'];
|
||||
@@ -112,6 +114,9 @@ else
|
||||
$typ = $bmt->result[0]->beschreibung;
|
||||
|
||||
$bm = new betriebsmittel($bmp->betriebsmittel_id);
|
||||
|
||||
$bestellung = new wawi_bestellung($bm->bestellung_id);
|
||||
$firma = new firma($bestellung->firma_id);
|
||||
|
||||
echo '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>';
|
||||
echo '
|
||||
@@ -133,8 +138,10 @@ else
|
||||
<nummer><![CDATA['.$bmp->nummer.']]></nummer>
|
||||
<nummer2><![CDATA['.$bmp->nummer2.']]></nummer2>
|
||||
<betriebsmitteltyp><![CDATA['.$bmp->betriebsmitteltyp.']]></betriebsmitteltyp>
|
||||
<bestellnummer><![CDATA['.$bm->bestellung_id.']]></bestellnummer>
|
||||
<bestellnummer><![CDATA['.$bestellung->bestell_nr.']]></bestellnummer>
|
||||
<hersteller><![CDATA['.$bm->hersteller.']]></hersteller>
|
||||
<bestellung_id><![CDATA['.$bm->bestellung_id.']]></bestellung_id>
|
||||
<lieferfirma><![CDATA['.$firma->name.']]></lieferfirma>
|
||||
<typ><![CDATA['.$typ.']]></typ>
|
||||
<datum><![CDATA['.date("d.m.Y").']]></datum>
|
||||
</betriebsmittelperson>
|
||||
|
||||
+31
-31
@@ -88,7 +88,7 @@ if (isset($_REQUEST["xmlformat"]) && $_REQUEST["xmlformat"] == "xml")
|
||||
if(isset($_GET['ss']))
|
||||
$studiensemester_kurzbz = $_GET['ss'];
|
||||
else
|
||||
$studiensemester_kurzbz = $semester_aktuell;
|
||||
die('Studiensemester wurde nicht uebergeben');
|
||||
|
||||
//Daten holen
|
||||
|
||||
@@ -151,12 +151,12 @@ if (isset($_REQUEST["xmlformat"]) && $_REQUEST["xmlformat"] == "xml")
|
||||
$bezeichnung = '';
|
||||
|
||||
|
||||
$xml .= " <studiensemester>".$row->sembezeichnung."</studiensemester>";
|
||||
$xml .= " <stsem>".$row->stsem."</stsem>";
|
||||
$xml .= " <semester>".$row->semester."</semester>";
|
||||
$xml .= " <semester_bezeichnung>".$bezeichnung."</semester_bezeichnung>";
|
||||
$xml .= " <studiengang>".$row->bezeichnung."</studiengang>";
|
||||
$xml .= " <studiengang_englisch>".$row->english."</studiengang_englisch>";
|
||||
$xml .= " <studiensemester><![CDATA[".$row->sembezeichnung."]]></studiensemester>";
|
||||
$xml .= " <stsem><![CDATA[".$row->stsem."]]></stsem>";
|
||||
$xml .= " <semester><![CDATA[".$row->semester."]]></semester>";
|
||||
$xml .= " <semester_bezeichnung><![CDATA[".$bezeichnung."]]></semester_bezeichnung>";
|
||||
$xml .= " <studiengang><![CDATA[".$row->bezeichnung."]]></studiengang>";
|
||||
$xml .= " <studiengang_englisch><![CDATA[".$row->english."]]></studiengang_englisch>";
|
||||
if($row->typ=='b')
|
||||
$bezeichnung='Bachelor';
|
||||
elseif($row->typ=='m')
|
||||
@@ -179,18 +179,18 @@ if (isset($_REQUEST["xmlformat"]) && $_REQUEST["xmlformat"] == "xml")
|
||||
else
|
||||
$studiengang_kz = sprintf("%04s", abs($row->studiengang_kz));
|
||||
|
||||
$xml .= " <studiengang_art>".$bezeichnung."</studiengang_art>";
|
||||
$xml .= " <studiengang_kz>".$studiengang_kz."</studiengang_kz>";
|
||||
$xml .= "\n <anrede>".$row->anrede."</anrede>";
|
||||
$xml .= "\n <vorname>".$row->vorname."</vorname>";
|
||||
$xml .= " <nachname>".$row->nachname."</nachname>";
|
||||
$xml .= " <name>".trim($row->titelpre.' '.trim($row->vorname.' '.$row->vornamen).' '.$row->nachname.($row->titelpost!=''?', '.$row->titelpost:''))."</name>";
|
||||
$xml .= " <studiengang_art><![CDATA[".$bezeichnung."]]></studiengang_art>";
|
||||
$xml .= " <studiengang_kz><![CDATA[".$studiengang_kz."]]></studiengang_kz>";
|
||||
$xml .= "\n <anrede><![CDATA[".$row->anrede."]]></anrede>";
|
||||
$xml .= "\n <vorname><![CDATA[".$row->vorname."]]></vorname>";
|
||||
$xml .= " <nachname><![CDATA[".$row->nachname."]]></nachname>";
|
||||
$xml .= " <name><![CDATA[".trim($row->titelpre.' '.trim($row->vorname.' '.$row->vornamen).' '.$row->nachname.($row->titelpost!=''?', '.$row->titelpost:''))."]]></name>";
|
||||
$gebdatum = date('d.m.Y',strtotime($row->gebdatum));
|
||||
$xml .= " <gebdatum>".$gebdatum."</gebdatum>";
|
||||
$xml .= " <matrikelnr>".trim($row->matrikelnr)."</matrikelnr>";
|
||||
$xml .= " <studiengangsleiter>".$stgl."</studiengangsleiter>";
|
||||
$xml .= " <gebdatum><![CDATA[".$gebdatum."]]></gebdatum>";
|
||||
$xml .= " <matrikelnr><![CDATA[".trim($row->matrikelnr)."]]></matrikelnr>";
|
||||
$xml .= " <studiengangsleiter><![CDATA[".$stgl."]]></studiengangsleiter>";
|
||||
$datum_aktuell = date('d.m.Y');
|
||||
$xml .= " <ort_datum>".$datum_aktuell."</ort_datum>";
|
||||
$xml .= " <ort_datum><![CDATA[".$datum_aktuell."]]></ort_datum>";
|
||||
$xml .= " <projektarbeit_note_anzeige>".($row->projektarbeit_note_anzeige=='t'?'true':'false')."</projektarbeit_note_anzeige>";
|
||||
|
||||
$qry_proj = "
|
||||
@@ -239,10 +239,10 @@ if (isset($_REQUEST["xmlformat"]) && $_REQUEST["xmlformat"] == "xml")
|
||||
{
|
||||
if($row_abschlusspruefung = $db->db_fetch_object($result_abschlusspruefung))
|
||||
{
|
||||
$xml .= " <abschlusspruefung_typ>".$row_abschlusspruefung->pruefungstyp_kurzbz."</abschlusspruefung_typ>";
|
||||
$xml .= " <abschlusspruefung_datum>".$datum->formatDatum($row_abschlusspruefung->datum,'d.m.Y')."</abschlusspruefung_datum>";
|
||||
$xml .= " <abschlusspruefung_note>".$row_abschlusspruefung->bezeichnung."</abschlusspruefung_note>";
|
||||
$xml .= " <abschlusspruefung_note_english>".$row_abschlusspruefung->bezeichnung_english."</abschlusspruefung_note_english>";
|
||||
$xml .= " <abschlusspruefung_typ><![CDATA[".$row_abschlusspruefung->pruefungstyp_kurzbz."]]></abschlusspruefung_typ>";
|
||||
$xml .= " <abschlusspruefung_datum><![CDATA[".$datum->formatDatum($row_abschlusspruefung->datum,'d.m.Y')."]]></abschlusspruefung_datum>";
|
||||
$xml .= " <abschlusspruefung_note><![CDATA[".$row_abschlusspruefung->bezeichnung."]]></abschlusspruefung_note>";
|
||||
$xml .= " <abschlusspruefung_note_english><![CDATA[".$row_abschlusspruefung->bezeichnung_english."]]></abschlusspruefung_note_english>";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -378,9 +378,9 @@ if (isset($_REQUEST["xmlformat"]) && $_REQUEST["xmlformat"] == "xml")
|
||||
$xml .= "\n <unterrichtsfach>";
|
||||
$xml .= " <bezeichnung><![CDATA[".$bezeichnung."]]></bezeichnung>";
|
||||
$xml .= " <bezeichnung_englisch><![CDATA[".$bezeichnung_englisch."]]></bezeichnung_englisch>";
|
||||
$xml .= " <note>".$note2."</note>";
|
||||
$xml .= " <sws>".($row->semesterstunden==0?'':number_format(sprintf('%.1F',$row->semesterstunden/$wochen),1))."</sws>";
|
||||
$xml .= " <sws_lv>".($row->sws==0?'':number_format(sprintf('%.1F',$row->sws),1))."</sws_lv>";
|
||||
$xml .= " <note><![CDATA[".$note2."]]></note>";
|
||||
$xml .= " <sws><![CDATA[".($row->semesterstunden==0?'':number_format(sprintf('%.1F',$row->semesterstunden/$wochen),1))."]]></sws>";
|
||||
$xml .= " <sws_lv><![CDATA[".($row->sws==0?'':number_format(sprintf('%.1F',$row->sws),1))."]]></sws_lv>";
|
||||
$ectspunkte='';
|
||||
|
||||
$anrechnung = new anrechnung();
|
||||
@@ -407,19 +407,19 @@ if (isset($_REQUEST["xmlformat"]) && $_REQUEST["xmlformat"] == "xml")
|
||||
}
|
||||
$ects_gesamt+=$ectspunkte;
|
||||
|
||||
$xml .= " <ects>".$ectspunkte."</ects>";
|
||||
$xml .= " <lv_lehrform_kurzbz>".$row->lv_lehrform_kurzbz."</lv_lehrform_kurzbz>";
|
||||
$xml .= " <ects><![CDATA[".$ectspunkte."]]></ects>";
|
||||
$xml .= " <lv_lehrform_kurzbz><![CDATA[".$row->lv_lehrform_kurzbz."]]></lv_lehrform_kurzbz>";
|
||||
if($auslandssemester)
|
||||
{
|
||||
$xml .= " <bisio_von>".date('d.m.Y', $datum->mktime_fromdate($bisio_von))."</bisio_von>";
|
||||
$xml .= " <bisio_bis>".date('d.m.Y', $datum->mktime_fromdate($bisio_bis))."</bisio_bis>";
|
||||
$xml .= " <bisio_ort>$bisio_ort</bisio_ort>";
|
||||
$xml .= " <bisio_universitaet>$bisio_universitaet</bisio_universitaet>";
|
||||
$xml .= " <bisio_von><![CDATA[".date('d.m.Y', $datum->mktime_fromdate($bisio_von))."]]></bisio_von>";
|
||||
$xml .= " <bisio_bis><![CDATA[".date('d.m.Y', $datum->mktime_fromdate($bisio_bis))."]]></bisio_bis>";
|
||||
$xml .= " <bisio_ort><![CDATA[$bisio_ort]]></bisio_ort>";
|
||||
$xml .= " <bisio_universitaet><![CDATA[$bisio_universitaet]]></bisio_universitaet>";
|
||||
}
|
||||
$xml .= " </unterrichtsfach>";
|
||||
}
|
||||
}
|
||||
$xml .= "<ects_gesamt>".$ects_gesamt."</ects_gesamt>";
|
||||
$xml .= "<ects_gesamt><![CDATA[".$ects_gesamt."]]></ects_gesamt>";
|
||||
$xml .= $xml_fussnote;
|
||||
|
||||
}
|
||||
|
||||
+11
-1
@@ -1,3 +1,13 @@
|
||||
/*custom styles for sb admin 2 template: https://startbootstrap.com/template-overviews/sb-admin-2/*/
|
||||
|
||||
/*optional header at right side of the main header*/
|
||||
.headerright{
|
||||
margin: 40px 0 20px -30px;
|
||||
padding: 6.4px 0 9px;
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
|
||||
/*change of panel colors (grey) */
|
||||
.panel-primary > .panel-heading{
|
||||
color: black;
|
||||
background-color: #dfdfdf;
|
||||
@@ -6,4 +16,4 @@
|
||||
|
||||
.panel-primary{
|
||||
border-color: #dfdfdf;
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,6 @@
|
||||
/*stylesheet for sb admin 2 pages that do not have menu and toolbar*/
|
||||
@import "admintemplate.css";
|
||||
|
||||
@media (min-width:768px) {
|
||||
#page-wrapper {
|
||||
margin-right: 250px;
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 4.7 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 8.3 KiB |
@@ -444,6 +444,39 @@ $error_msg='';
|
||||
AND tbl_lehrveranstaltung.studiengang_kz=257
|
||||
AND tbl_lehrveranstaltung.orgform_kurzbz='DUA'
|
||||
";
|
||||
|
||||
$verteilerArray['pre_alumni_wintersemester']['bezeichnung'] = 'Zukünftige Absolventen Wintersemester';
|
||||
$verteilerArray['pre_alumni_wintersemester']['beschreibung'] = 'Zukünftige Absolventen Wintersemester';
|
||||
$verteilerArray['pre_alumni_wintersemester']['sql'] = "SELECT
|
||||
distinct tbl_benutzer.uid
|
||||
FROM
|
||||
public.tbl_studentlehrverband
|
||||
JOIN public.tbl_studiengang USING(studiengang_kz)
|
||||
JOIN public.tbl_benutzer ON(uid=student_uid)
|
||||
WHERE
|
||||
(
|
||||
(tbl_studiengang.typ='m' AND semester=3)
|
||||
OR (tbl_studiengang.typ='b' AND semester=5)
|
||||
)
|
||||
AND tbl_benutzer.aktiv = true
|
||||
AND tbl_studentlehrverband.studiensemester_kurzbz = (SELECT studiensemester_kurzbz FROM public.vw_studiensemester where studiensemester_kurzbz like 'WS%' ORDER BY delta LIMIT 1)";
|
||||
|
||||
$verteilerArray['pre_alumni_sommersemester']['bezeichnung'] = 'Zukünftige Absolventen Sommersemester';
|
||||
$verteilerArray['pre_alumni_sommersemester']['beschreibung'] = 'Zukünftige Absolventen Sommersemester';
|
||||
$verteilerArray['pre_alumni_sommersemester']['sql'] = "SELECT
|
||||
distinct tbl_benutzer.uid
|
||||
FROM
|
||||
public.tbl_studentlehrverband
|
||||
JOIN public.tbl_studiengang USING(studiengang_kz)
|
||||
JOIN public.tbl_benutzer ON(uid=student_uid)
|
||||
WHERE
|
||||
(
|
||||
(tbl_studiengang.typ='m' AND semester=4)
|
||||
OR (tbl_studiengang.typ='b' AND semester=6)
|
||||
)
|
||||
AND tbl_benutzer.aktiv = true
|
||||
AND tbl_studentlehrverband.studiensemester_kurzbz = (SELECT studiensemester_kurzbz FROM public.vw_studiensemester where studiensemester_kurzbz like 'SS%' ORDER BY delta LIMIT 1)";
|
||||
|
||||
$bezeichnung = '';
|
||||
$beschreibung = '';
|
||||
foreach ($verteilerArray AS $listname => $data)
|
||||
|
||||
@@ -261,14 +261,14 @@
|
||||
<draw:image xlink:href="{foto_url}" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"/>
|
||||
</draw:frame>
|
||||
</xsl:when>
|
||||
<xsl:when test="foto_url=''">
|
||||
<xsl:when test="foto_gesperrt!='f'">
|
||||
<draw:frame draw:style-name="fr1" draw:name="Bild2" text:anchor-type="as-char" svg:width="2.57cm" svg:height="3.431cm" draw:z-index="0">
|
||||
<draw:image xlink:href="Pictures/dummyfoto_keinBildVorhanden.jpg" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"/>
|
||||
<draw:image xlink:href="Pictures/10000000000000F000000140BF2FB93E89B12D34.jpg" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"/>
|
||||
</draw:frame>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<draw:frame draw:style-name="fr1" draw:name="dummy" text:anchor-type="as-char" svg:width="2.57cm" svg:height="3.431cm" draw:z-index="0">
|
||||
<draw:image xlink:href="Pictures/10000000000000F000000140BF2FB93E89B12D34.jpg" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"/>
|
||||
<draw:image xlink:href="Pictures/dummyfoto_keinBildVorhanden.jpg" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"/>
|
||||
</draw:frame>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
@@ -222,20 +222,35 @@ xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0"
|
||||
<text:p text:style-name="P18">Bestellnummer</text:p>
|
||||
</table:table-cell>
|
||||
<table:table-cell table:style-name="Tabelle2.B1" office:value-type="string">
|
||||
<text:p text:style-name="P17"><xsl:value-of select="bestellnummer" /></text:p>
|
||||
<text:p text:style-name="P17">
|
||||
<xsl:choose>
|
||||
<xsl:when test="bestellnummer=''">
|
||||
<xsl:text>-</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="bestellnummer" />
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</text:p>
|
||||
</table:table-cell>
|
||||
</table:table-row>
|
||||
<table:table-row>
|
||||
<table:table-cell table:style-name="Tabelle2.A1" office:value-type="string">
|
||||
<text:p text:style-name="P18">Firma</text:p>
|
||||
</table:table-cell>
|
||||
<table:table-cell table:style-name="Tabelle2.B1" office:value-type="string">
|
||||
<text:p text:style-name="P17">
|
||||
<xsl:choose>
|
||||
<xsl:when test="lieferfirma=''">
|
||||
<xsl:text>-</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="lieferfirma" />
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</text:p>
|
||||
</table:table-cell>
|
||||
</table:table-row>
|
||||
<!--add line "firma" only if hersteller is not null-->
|
||||
<xsl:if test="hersteller != ''">
|
||||
<table:table-row>
|
||||
<table:table-cell table:style-name="Tabelle2.A1" office:value-type="string">
|
||||
<text:p text:style-name="P18">Firma</text:p>
|
||||
</table:table-cell>
|
||||
<table:table-cell table:style-name="Tabelle2.B1" office:value-type="string">
|
||||
<text:p text:style-name="P17"><xsl:value-of select="hersteller" /></text:p>
|
||||
</table:table-cell>
|
||||
</table:table-row>
|
||||
</xsl:if>
|
||||
<table:table-row>
|
||||
<table:table-cell table:style-name="Tabelle2.A2" office:value-type="string">
|
||||
<text:p text:style-name="P18">Inventarnummer</text:p>
|
||||
|
||||
Reference in New Issue
Block a user