mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 12:19:28 +00:00
Merge branch 'master' into feature-17517/AdaptierungenZeiterfassungenSprint177
This commit is contained in:
+28
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Job for resolving core issues
|
||||
*/
|
||||
class IssueResolver extends IssueResolver_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
// set fehler codes which can be resolved by the job
|
||||
// structure: fehlercode => class (library) name for resolving
|
||||
$this->_codeLibMappings = array(
|
||||
'CORE_ZGV_0001' => 'CORE_ZGV_0001',
|
||||
'CORE_ZGV_0002' => 'CORE_ZGV_0002',
|
||||
'CORE_ZGV_0003' => 'CORE_ZGV_0003',
|
||||
'CORE_ZGV_0004' => 'CORE_ZGV_0004',
|
||||
'CORE_ZGV_0005' => 'CORE_ZGV_0005',
|
||||
'CORE_INOUT_0001' => 'CORE_INOUT_0001',
|
||||
'CORE_INOUT_0002' => 'CORE_INOUT_0002',
|
||||
'CORE_INOUT_0003' => 'CORE_INOUT_0003',
|
||||
'CORE_INOUT_0004' => 'CORE_INOUT_0004',
|
||||
'CORE_INOUT_0005' => 'CORE_INOUT_0005',
|
||||
'CORE_INOUT_0006' => 'CORE_INOUT_0006'
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -560,8 +560,10 @@ class InfoCenter extends Auth_Controller
|
||||
/**
|
||||
* Sendet bei einer neuen ZGV Prüfung die Mail raus an den Studiengang
|
||||
*/
|
||||
private function sendZgvMail($mail, $typ){
|
||||
private function sendZgvMail($mail, $typ, $person){
|
||||
$data = array(
|
||||
'vorname' => $person->vorname,
|
||||
'nachname' => $person->nachname,
|
||||
'link' => site_url('system/infocenter/ZGVUeberpruefung')
|
||||
);
|
||||
|
||||
@@ -657,6 +659,16 @@ class InfoCenter extends Auth_Controller
|
||||
if (isEmptyString($prestudent_id) || isEmptyString($person_id))
|
||||
$this->terminateWithJsonError('Prestudentid OR/AND Personid missing');
|
||||
|
||||
$person = $this->PersonModel->load($person_id);
|
||||
|
||||
if (isError($person))
|
||||
$this->terminateWithJsonError(getError($person));
|
||||
|
||||
if (!hasData($person))
|
||||
$this->terminateWithJsonError('Person existiert nicht.');
|
||||
|
||||
$person = getData($person)[0];
|
||||
|
||||
$zgv = $this->ZGVPruefungStatusModel->getZgvStatusByPrestudent($prestudent_id);
|
||||
|
||||
$data = $this->_getPersonAndStudiengangFromPrestudent($prestudent_id);
|
||||
@@ -688,7 +700,7 @@ class InfoCenter extends Auth_Controller
|
||||
$this->_log($person_id, 'updatezgv', array($zgv[0]->zgvpruefung_id, 'pruefung_stg'));
|
||||
|
||||
if (isSuccess($insert))
|
||||
$this->sendZgvMail($mail, $typ);
|
||||
$this->sendZgvMail($mail, $typ, $person);
|
||||
elseif (isError($insert))
|
||||
$this->terminateWithJsonError('Fehler beim Speichern');
|
||||
}else
|
||||
@@ -714,7 +726,7 @@ class InfoCenter extends Auth_Controller
|
||||
$this->_log($person_id, 'newzgv', array($zgvpruefung_id));
|
||||
|
||||
if (isSuccess($result))
|
||||
$this->sendZgvMail($mail, $typ);
|
||||
$this->sendZgvMail($mail, $typ, $person);
|
||||
elseif (isError($result))
|
||||
$this->terminateWithJsonError('Fehler beim Speichern');
|
||||
}
|
||||
@@ -1708,9 +1720,15 @@ class InfoCenter extends Auth_Controller
|
||||
|
||||
if (isset($locked->retval[0]->uid))
|
||||
{
|
||||
$lockedby = $locked->retval[0]->uid;
|
||||
if ($lockedby !== $this->_uid)
|
||||
if (!$lockedby = getData($this->PersonModel->getFullName($locked->retval[0]->uid)))
|
||||
{
|
||||
show_error('Failed retrieving person');
|
||||
}
|
||||
|
||||
if ($locked->retval[0]->uid !== $this->_uid)
|
||||
{
|
||||
$lockedbyother = true;
|
||||
}
|
||||
}
|
||||
|
||||
$stammdaten = $this->PersonModel->getPersonStammdaten($person_id, true);
|
||||
|
||||
@@ -58,21 +58,42 @@ class Issues extends Auth_Controller
|
||||
{
|
||||
$issue_ids = $this->input->post('issue_ids');
|
||||
$status_kurzbz = $this->input->post('status_kurzbz');
|
||||
$verarbeitetvon = $this->_uid;
|
||||
$user = $this->_uid;
|
||||
|
||||
$errors = array();
|
||||
foreach ($issue_ids as $issue_id)
|
||||
{
|
||||
$issueRes = $this->issueslib->changeIssueStatus($issue_id, $status_kurzbz, $verarbeitetvon);
|
||||
switch ($status_kurzbz)
|
||||
{
|
||||
case IssuesLib::STATUS_NEU:
|
||||
$changeIssueMethod = 'setNeu';
|
||||
break;
|
||||
case IssuesLib::STATUS_IN_BEARBEITUNG:
|
||||
$changeIssueMethod = 'setInBearbeitung';
|
||||
break;
|
||||
case IssuesLib::STATUS_BEHOBEN:
|
||||
$changeIssueMethod = 'setBehoben';
|
||||
break;
|
||||
default:
|
||||
$changeIssueMethod = null;
|
||||
break;
|
||||
}
|
||||
|
||||
if (isError($issueRes))
|
||||
$errors[] = getError($issueRes);
|
||||
if (isEmptyString($changeIssueMethod))
|
||||
$errors[] = error("Invalid issue status given");
|
||||
else
|
||||
{
|
||||
$issueRes = $this->issueslib->{$changeIssueMethod}($issue_id, $user);
|
||||
|
||||
if (isError($issueRes))
|
||||
$errors[] = getError($issueRes);
|
||||
}
|
||||
}
|
||||
|
||||
if (!isEmptyArray($errors))
|
||||
$this->outputJsonError(implode(", ", $errors));
|
||||
else
|
||||
$this->outputJsonSuccess("Status erfolgreich aktualisiert");
|
||||
$this->outputJsonSuccess("Status successfully refreshed");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -133,7 +154,7 @@ class Issues extends Auth_Controller
|
||||
|
||||
// add oes for which there is the "manage issues" Berechtigung
|
||||
if (!$oe_kurzbz_berechtigt = $this->permissionlib->getOE_isEntitledFor(self::BERECHTIGUNG_KURZBZ))
|
||||
show_error('Keine Berechtigung oder Fehler bei Berechtigungsprüfung');
|
||||
show_error('No permission or error when checking permissions');
|
||||
|
||||
$all_oe_kurzbz_berechtigt = array_unique(array_merge($oe_kurzbz_for_funktion, $oe_kurzbz_berechtigt));
|
||||
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Interface defining method to implement for issue resolution checker (from core and extensions)
|
||||
*/
|
||||
interface IIssueResolvedChecker
|
||||
{
|
||||
/**
|
||||
* Checks if a issue of a certain type is resolved.
|
||||
* Classes for resolving a certain issue type implement this method.
|
||||
* @param array $params parameters needed for issue resolution
|
||||
* @return object with success(true) if issue resolved, success(false) otherwise
|
||||
*/
|
||||
public function checkIfIssueIsResolved($params);
|
||||
}
|
||||
+119
@@ -0,0 +1,119 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Controller for retrieving open issues and, if the issue condition is not met anymore, automatically set it to resolved
|
||||
*/
|
||||
abstract class IssueResolver_Controller extends JOB_Controller
|
||||
{
|
||||
const ISSUES_FOLDER = 'issues';
|
||||
const CHECK_ISSUE_RESOLVED_METHOD_NAME = 'checkIfIssueIsResolved';
|
||||
|
||||
protected $_codeLibMappings;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->load->model('system/Issue_model', 'IssueModel');
|
||||
|
||||
$this->load->library('IssuesLib');
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes issue resolution.
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
$this->logInfo("Issue resolve job started");
|
||||
|
||||
// load open issues with given errorcodes
|
||||
$openIssuesRes = $this->IssueModel->getOpenIssues(array_keys($this->_codeLibMappings));
|
||||
|
||||
// log error if occured
|
||||
if (isError($openIssuesRes))
|
||||
{
|
||||
$this->logError(getError($openIssuesRes));
|
||||
}
|
||||
else
|
||||
{
|
||||
// log info if no data found
|
||||
if (!hasData($openIssuesRes))
|
||||
{
|
||||
$this->logInfo("No open issues found");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
$openIssues = getData($openIssuesRes);
|
||||
|
||||
foreach ($openIssues as $issue)
|
||||
{
|
||||
if (isset($this->_codeLibMappings[$issue->fehlercode]))
|
||||
{
|
||||
$libName = $this->_codeLibMappings[$issue->fehlercode];
|
||||
|
||||
// add person id and oe kurzbz automatically as params, merge it with additional params
|
||||
// decode bewerbung_parameter into assoc array
|
||||
$params = array_merge(
|
||||
array('issue_id' => $issue->issue_id, 'issue_person_id' => $issue->person_id, 'issue_oe_kurzbz' => $issue->oe_kurzbz),
|
||||
isset($issue->behebung_parameter) ? json_decode($issue->behebung_parameter, true) : array()
|
||||
);
|
||||
|
||||
// if called from extension (extension name set), path includes extension names, otherwise it is the core library folder
|
||||
$libRootPath = isset($this->_extensionName) ? 'extensions/' . $this->_extensionName . '/' : '';
|
||||
$issuesLibPath = $libRootPath . self::ISSUES_FOLDER . '/';
|
||||
$issuesLibFilePath = DOC_ROOT . 'application/' . $libRootPath . 'libraries/' . self::ISSUES_FOLDER . '/' . $libName . '.php';
|
||||
|
||||
// check if library file exists
|
||||
if (!file_exists($issuesLibFilePath))
|
||||
{
|
||||
// log error and continue with next issue if not
|
||||
$this->logError("Issue library file " . $issuesLibFilePath . " does not exist");
|
||||
continue;
|
||||
}
|
||||
|
||||
// load library connected to fehlercode
|
||||
$this->load->library(
|
||||
$issuesLibPath . $libName
|
||||
);
|
||||
|
||||
$lowercaseLibName = mb_strtolower($libName);
|
||||
|
||||
// check if method is defined in libary class
|
||||
if (!is_callable(array($this->{$lowercaseLibName}, self::CHECK_ISSUE_RESOLVED_METHOD_NAME)))
|
||||
{
|
||||
// log error and continue with next issue if not
|
||||
$this->logError("Method " . self::CHECK_ISSUE_RESOLVED_METHOD_NAME . " is not defined in library $lowercaseLibName");
|
||||
continue;
|
||||
}
|
||||
|
||||
// call the function for checking for issue resolution
|
||||
$issueResolvedRes = $this->{$lowercaseLibName}->{self::CHECK_ISSUE_RESOLVED_METHOD_NAME}($params);
|
||||
|
||||
if (isError($issueResolvedRes))
|
||||
{
|
||||
$this->logError(getError($issueResolvedRes));
|
||||
}
|
||||
else
|
||||
{
|
||||
$issueResolvedData = getData($issueResolvedRes);
|
||||
|
||||
if ($issueResolvedData === true)
|
||||
{
|
||||
// set issue to resolved if needed
|
||||
$behobenRes = $this->issueslib->setBehoben($issue->issue_id, null);
|
||||
|
||||
if (isError($behobenRes))
|
||||
$this->logError(getError($behobenRes));
|
||||
else
|
||||
$this->logInfo("Issue " . $issue->issue_id . " successfully resolved");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->logInfo("Issue resolve job ended");
|
||||
}
|
||||
}
|
||||
@@ -62,17 +62,17 @@ class IssuesLib
|
||||
* @param array $fehlertext_params params for sprint replace of error text in system.tbl_fehler
|
||||
* @return object success or error
|
||||
*/
|
||||
public function addFhcIssue($fehler_kurzbz, $person_id = null, $oe_kurzbz = null, $fehlertext_params = null)
|
||||
public function addFhcIssue($fehler_kurzbz, $person_id = null, $oe_kurzbz = null, $fehlertext_params = null, $resolution_params = null)
|
||||
{
|
||||
$fehlerRes = $this->_ci->FehlerModel->loadWhere(array('fehler_kurzbz' => $fehler_kurzbz));
|
||||
|
||||
if (hasData($fehlerRes))
|
||||
{
|
||||
$fehlercode = getData($fehlerRes)[0]->fehlercode;
|
||||
return $this->_addIssue($fehlercode, $person_id, $oe_kurzbz, $fehlertext_params);
|
||||
return $this->_addIssue($fehlercode, $person_id, $oe_kurzbz, $fehlertext_params, $resolution_params);
|
||||
}
|
||||
else
|
||||
return error("Fehler $fehler_kurzbz nicht gefunden");
|
||||
return error("Error $fehler_kurzbz not found");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -82,13 +82,13 @@ class IssuesLib
|
||||
* @param int $person_id
|
||||
* @param int $oe_kurzbz
|
||||
* @param array $fehlertext_params params for replacement of parts of error text
|
||||
* @param bool $force_predefined if true, only predefined external issues are added
|
||||
* @param bool $force_predefined if true, only predefined (with entry in fehler table) external issues are added
|
||||
* @return object success or error
|
||||
*/
|
||||
public function addExternalIssue($fehlercode_extern, $inhalt_extern, $person_id = null, $oe_kurzbz = null, $fehlertext_params = null, $force_predefined = false)
|
||||
public function addExternalIssue($fehlercode_extern, $inhalt_extern, $person_id = null, $oe_kurzbz = null, $fehlertext_params = null)
|
||||
{
|
||||
if (isEmptyString($fehlercode_extern))
|
||||
return error("fehlercode_extern fehlt");
|
||||
return error("fehlercode_extern missing");
|
||||
|
||||
// get external fehlercode (unique for each app)
|
||||
$this->_ci->FehlerModel->addSelect('fehlercode');
|
||||
@@ -102,19 +102,13 @@ class IssuesLib
|
||||
if (isError($fehlerRes))
|
||||
return $fehlerRes;
|
||||
|
||||
$fehlerData = getData($fehlerRes)[0];
|
||||
|
||||
// check if there is a predefined custom error for the external issue
|
||||
if (hasData($fehlerRes))
|
||||
{
|
||||
$fehlerData = getData($fehlerRes)[0];
|
||||
// if found, use the code
|
||||
$fehlercode = $fehlerData->fehlercode;
|
||||
}
|
||||
elseif ($force_predefined === true)
|
||||
{
|
||||
// only added if predefined
|
||||
return success("No definition found - not added");
|
||||
}
|
||||
else
|
||||
{
|
||||
// if predefined error is not found, insert with fallback code
|
||||
@@ -122,20 +116,70 @@ class IssuesLib
|
||||
}
|
||||
|
||||
// add external issue
|
||||
return $this->_addIssue($fehlercode, $person_id, $oe_kurzbz, $fehlertext_params, $fehlercode_extern, $inhalt_extern);
|
||||
return $this->_addIssue($fehlercode, $person_id, $oe_kurzbz, $fehlertext_params, null, $fehlercode_extern, $inhalt_extern);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set issue to resolved.
|
||||
* @param int $issue_id
|
||||
* @param string $user uid of issue resolver
|
||||
* @return object success or error
|
||||
*/
|
||||
public function setBehoben($issue_id, $user)
|
||||
{
|
||||
$data = array(
|
||||
'status_kurzbz' => self::STATUS_BEHOBEN,
|
||||
'verarbeitetvon' => $user,
|
||||
'verarbeitetamum' => date('Y-m-d H:i:s')
|
||||
);
|
||||
|
||||
return $this->_changeIssueStatus($issue_id, $data, $user);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set issue to in progress.
|
||||
* @param int $issue_id
|
||||
* @param string $user uid of issue resovler
|
||||
* @return object success or error
|
||||
*/
|
||||
public function setInBearbeitung($issue_id, $user)
|
||||
{
|
||||
$data = array(
|
||||
'status_kurzbz' => self::STATUS_IN_BEARBEITUNG,
|
||||
'verarbeitetvon' => $user
|
||||
);
|
||||
|
||||
return $this->_changeIssueStatus($issue_id, $data, $user);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set issue to new.
|
||||
* @param int $issue_id
|
||||
* @param string $user uid of issue resolver
|
||||
* @return object success or error
|
||||
*/
|
||||
public function setNeu($issue_id, $user)
|
||||
{
|
||||
$data = array(
|
||||
'status_kurzbz' => self::STATUS_NEU,
|
||||
'verarbeitetvon' => null,
|
||||
'verarbeitetamum' => null
|
||||
);
|
||||
|
||||
return $this->_changeIssueStatus($issue_id, $data, $user);
|
||||
}
|
||||
|
||||
/**
|
||||
* Changes status of an issue.
|
||||
* @param int $issue_id
|
||||
* @param string $status_kurzbz the new status
|
||||
* @param string $verarbeitetvon uid of person changing the status (needed for in Bearbeitung and behoben)
|
||||
* @param array $sdata the data to save, including status
|
||||
* @param string $user uid of person changing the status (needed for in Bearbeitung and behoben)
|
||||
* @return success or error
|
||||
*/
|
||||
public function changeIssueStatus($issue_id, $status_kurzbz, $verarbeitetvon = null)
|
||||
private function _changeIssueStatus($issue_id, $data, $user)
|
||||
{
|
||||
if (!isset($issue_id) || !is_numeric($issue_id))
|
||||
return error("Issue Id muss korrekt gesetzt sein.");
|
||||
return error("Issue Id must be set correctly.");
|
||||
|
||||
// check if given status is same as existing
|
||||
$this->_ci->IssueModel->addSelect('status_kurzbz');
|
||||
@@ -143,39 +187,14 @@ class IssuesLib
|
||||
|
||||
if (hasData($currStatus))
|
||||
{
|
||||
if (getData($currStatus)[0]->status_kurzbz == $status_kurzbz)
|
||||
return success("Gleicher Status bereits gesetzt");
|
||||
if (getData($currStatus)[0]->status_kurzbz == $data['status_kurzbz'])
|
||||
return success("Same status already set");
|
||||
}
|
||||
else
|
||||
return error("Fehler beim Holen des Status");
|
||||
return error("Error when getting status");
|
||||
|
||||
$data = array(
|
||||
'status_kurzbz' => $status_kurzbz,
|
||||
'updatevon' => $verarbeitetvon,
|
||||
'updateamum' => date('Y-m-d H:i:s')
|
||||
);
|
||||
|
||||
if ($status_kurzbz == self::STATUS_NEU)
|
||||
{
|
||||
|
||||
$data['verarbeitetvon'] = null;
|
||||
}
|
||||
|
||||
if ($status_kurzbz == self::STATUS_NEU || $status_kurzbz == self::STATUS_IN_BEARBEITUNG)
|
||||
{
|
||||
$data['verarbeitetamum'] = null;
|
||||
}
|
||||
|
||||
if ($status_kurzbz == self::STATUS_IN_BEARBEITUNG || $status_kurzbz == self::STATUS_BEHOBEN)
|
||||
{
|
||||
if (isset($verarbeitetvon))
|
||||
$data['verarbeitetvon'] = $verarbeitetvon;
|
||||
else
|
||||
return error("Verarbeitetvon nicht gesetzt");
|
||||
}
|
||||
|
||||
if ($status_kurzbz == self::STATUS_BEHOBEN)
|
||||
$data['verarbeitetamum'] = date('Y-m-d H:i:s');
|
||||
$data['updatevon'] = $user;
|
||||
$data['updateamum'] = date('Y-m-d H:i:s');
|
||||
|
||||
return $this->_ci->IssueModel->update(
|
||||
array(
|
||||
@@ -191,14 +210,15 @@ class IssuesLib
|
||||
* @param int $person_id
|
||||
* @param string $oe_kurzbz
|
||||
* @param array $fehlertext_params
|
||||
* @param string $resolution_params
|
||||
* @param string $fehlercode_extern
|
||||
* @param string $inhalt_extern
|
||||
* @return object success or error
|
||||
*/
|
||||
private function _addIssue($fehlercode, $person_id = null, $oe_kurzbz = null, $fehlertext_params = null, $fehlercode_extern = null, $inhalt_extern = null)
|
||||
private function _addIssue($fehlercode, $person_id = null, $oe_kurzbz = null, $fehlertext_params = null, $resolution_params = null, $fehlercode_extern = null, $inhalt_extern = null)
|
||||
{
|
||||
if (isEmptyString($person_id) && isEmptyString($oe_kurzbz))
|
||||
return error("Person_id oder oe_kurzbz muss gesetzt sein.");
|
||||
return error("Person_id or oe_kurzbz must be set.");
|
||||
|
||||
// get fehlertextVorlage and replace it with params
|
||||
$fehlerRes = $this->_ci->FehlerModel->load($fehlercode);
|
||||
@@ -218,6 +238,20 @@ class IssuesLib
|
||||
|
||||
if ($openIssueCount == 0)
|
||||
{
|
||||
if (isset($resolution_params))
|
||||
{
|
||||
if (is_array($resolution_params))
|
||||
{
|
||||
foreach ($resolution_params as $resolution_key => $resolution_param)
|
||||
{
|
||||
if (!is_string($resolution_key))
|
||||
return error("Invalid parameter for resolution, must be an associative array");
|
||||
}
|
||||
}
|
||||
else
|
||||
return error("Invalid parameters for resolution");
|
||||
}
|
||||
|
||||
return $this->_ci->IssueModel->insert(
|
||||
array(
|
||||
'fehlercode' => $fehlercode,
|
||||
@@ -228,6 +262,7 @@ class IssuesLib
|
||||
'oe_kurzbz' => $oe_kurzbz,
|
||||
'datum' => date('Y-m-d H:i:s'),
|
||||
'status_kurzbz' => self::STATUS_NEU,
|
||||
'behebung_parameter' => isset($resolution_params) ? json_encode($resolution_params) : null,
|
||||
'insertvon' => $this->_insertvon
|
||||
)
|
||||
);
|
||||
@@ -236,9 +271,9 @@ class IssuesLib
|
||||
return success($openIssueCount);
|
||||
}
|
||||
else
|
||||
return error("Anzahl offener Issues konnte nicht ermittelt werden.");
|
||||
return error("Number of open issues could not be determined");
|
||||
}
|
||||
else
|
||||
return error("Fehler $fehlercode nicht gefunden");
|
||||
return error("Error $fehlercode could not be found");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Bisio Zweck does not exist
|
||||
*/
|
||||
class CORE_INOUT_0001 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['bisio_id']) || !is_numeric($params['bisio_id']))
|
||||
return error('Bisio Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->model('codex/Bisiozweck_model', 'BisiozweckModel');
|
||||
|
||||
// get all bisio Zwecke
|
||||
$this->_ci->BisiozweckModel->addSelect('1');
|
||||
$bisiozweckRes = $this->_ci->BisiozweckModel->loadWhere(array('bisio_id' => $params['bisio_id']));
|
||||
|
||||
if (isError($bisiozweckRes))
|
||||
return $bisiozweckRes;
|
||||
|
||||
if (hasData($bisiozweckRes))
|
||||
return success(true); // resolved if bisio Zweck exists
|
||||
else
|
||||
return success(false); // not resolved if no bisio zweck
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* More than one Zweck for incoming
|
||||
*/
|
||||
class CORE_INOUT_0002 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['bisio_id']) || !is_numeric($params['bisio_id']))
|
||||
return error('Bisio Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->model('codex/Bisiozweck_model', 'BisiozweckModel');
|
||||
|
||||
// get all bisio Zwecke
|
||||
$this->_ci->BisiozweckModel->addSelect('1');
|
||||
$bisiozweckRes = $this->_ci->BisiozweckModel->loadWhere(array('bisio_id' => $params['bisio_id']));
|
||||
|
||||
if (isError($bisiozweckRes))
|
||||
return $bisiozweckRes;
|
||||
|
||||
if (hasData($bisiozweckRes))
|
||||
{
|
||||
if (count(getData($bisiozweckRes)) <= 1) // resolved if one bisio Zweck
|
||||
return success(true);
|
||||
else
|
||||
return success(false); // otherwise not resolved
|
||||
}
|
||||
else
|
||||
return success(true); // resolved if no bisio zweck
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Invalid Zweck for incoming
|
||||
*/
|
||||
class CORE_INOUT_0003 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['bisio_id']) || !is_numeric($params['bisio_id']))
|
||||
return error('Bisio Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->model('codex/Bisiozweck_model', 'BisiozweckModel');
|
||||
|
||||
// get all Zwecke
|
||||
$this->_ci->BisiozweckModel->addSelect('zweck_code');
|
||||
$bisiozweckRes = $this->_ci->BisiozweckModel->loadWhere(array('bisio_id' => $params['bisio_id']));
|
||||
|
||||
if (isError($bisiozweckRes))
|
||||
return $bisiozweckRes;
|
||||
|
||||
if (hasData($bisiozweckRes))
|
||||
{
|
||||
$bisiozweckData = getData($bisiozweckRes);
|
||||
|
||||
// resolved if Zweck is 1, 2 or 3
|
||||
if (count($bisiozweckData) == 1 && !in_array($bisiozweckData[0]->zweck_code, array(1, 2, 3)))
|
||||
return success(false);
|
||||
else
|
||||
return success(true);
|
||||
}
|
||||
else
|
||||
return success(true);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Aufenthaltsförderung must exist if certain length of outgoing stay is exceeded
|
||||
*/
|
||||
class CORE_INOUT_0004 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['bisio_id']) || !is_numeric($params['bisio_id']))
|
||||
return error('Bisio Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->model('codex/Aufenthaltfoerderung_model', 'AufenthaltfoerderungModel');
|
||||
|
||||
// get all Zwecke
|
||||
$this->_ci->AufenthaltfoerderungModel->addSelect('tbl_aufenthaltfoerderung.aufenthaltfoerderung_code');
|
||||
$this->_ci->AufenthaltfoerderungModel->addJoin('bis.tbl_bisio_aufenthaltfoerderung', 'aufenthaltfoerderung_code');
|
||||
$this->_ci->AufenthaltfoerderungModel->addOrder('tbl_aufenthaltfoerderung.aufenthaltfoerderung_code');
|
||||
$bisioFoerderungRes = $this->_ci->AufenthaltfoerderungModel->loadWhere(array('bisio_id' => $params['bisio_id']));
|
||||
|
||||
if (isError($bisioFoerderungRes))
|
||||
return $bisioFoerderungRes;
|
||||
|
||||
if (hasData($bisioFoerderungRes))
|
||||
{
|
||||
// resolved if Aufenthaltsfoerderung exists
|
||||
return success(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->_ci->load->model('codex/Bisio_model', 'BisioModel');
|
||||
|
||||
// get Bisio Aufenthaltsdauer
|
||||
$aufenthaltsdauerRes = $this->_ci->BisioModel->getAufenthaltsdauer($params['bisio_id']);
|
||||
|
||||
if (isError($aufenthaltsdauerRes))
|
||||
return $aufenthaltsdauerRes;
|
||||
|
||||
if (hasData($aufenthaltsdauerRes))
|
||||
{
|
||||
$aufenthaltsdauer = getData($aufenthaltsdauerRes);
|
||||
|
||||
// check if stay >= 29 days. If yes and no Aufenthaltsfoerderung - not resolved
|
||||
if ($aufenthaltsdauer >= 29)
|
||||
return success(false);
|
||||
else
|
||||
return success(true);
|
||||
}
|
||||
else // no Aufenthaltsdauer - not resolved
|
||||
return success(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* ECTS angerechnet must exist for outgoing if longer stay
|
||||
*/
|
||||
class CORE_INOUT_0005 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['bisio_id']) || !is_numeric($params['bisio_id']))
|
||||
return error('Bisio Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->model('codex/Bisio_model', 'BisioModel');
|
||||
|
||||
// get all Zwecke
|
||||
$this->_ci->BisioModel->addSelect('ects_angerechnet');
|
||||
$bisioRes = $this->_ci->BisioModel->loadWhere(array('bisio_id' => $params['bisio_id']));
|
||||
|
||||
if (isError($bisioRes))
|
||||
return $bisioRes;
|
||||
|
||||
if (hasData($bisioRes) && !isEmptyString(getData($bisioRes)[0]->ects_angerechnet))
|
||||
{
|
||||
// resolved if ects exists
|
||||
return success(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
// get Bisio Aufenthaltsdauer
|
||||
$aufenthaltsdauerRes = $this->_ci->BisioModel->getAufenthaltsdauer($params['bisio_id']);
|
||||
|
||||
if (isError($aufenthaltsdauerRes))
|
||||
return $aufenthaltsdauerRes;
|
||||
|
||||
if (hasData($aufenthaltsdauerRes))
|
||||
{
|
||||
$aufenthaltsdauer = getData($aufenthaltsdauerRes);
|
||||
|
||||
// check if stay >= 29 days. If yes and no ects - not resolved
|
||||
if ($aufenthaltsdauer >= 29)
|
||||
return success(false);
|
||||
else
|
||||
return success(true);
|
||||
}
|
||||
else // no Aufenthaltsdauer - not resolved
|
||||
return success(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* ECTS erworben must exist for outgoing if longer stay
|
||||
*/
|
||||
class CORE_INOUT_0006 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['bisio_id']) || !is_numeric($params['bisio_id']))
|
||||
return error('Bisio Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->model('codex/Bisio_model', 'BisioModel');
|
||||
//$this->_ci->load->model('codex/Aufenthaltfoerderung_model', 'AufenthaltfoerderungModel');
|
||||
|
||||
// get all Zwecke
|
||||
$this->_ci->BisioModel->addSelect('ects_erworben');
|
||||
$bisioRes = $this->_ci->BisioModel->loadWhere(array('bisio_id' => $params['bisio_id']));
|
||||
|
||||
if (isError($bisioRes))
|
||||
return $bisioRes;
|
||||
|
||||
if (hasData($bisioRes) && !isEmptyString(getData($bisioRes)[0]->ects_erworben))
|
||||
{
|
||||
// resolved if ects exists
|
||||
return success(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
// get Bisio Aufenthaltsdauer
|
||||
$aufenthaltsdauerRes = $this->_ci->BisioModel->getAufenthaltsdauer($params['bisio_id']);
|
||||
|
||||
if (isError($aufenthaltsdauerRes))
|
||||
return $aufenthaltsdauerRes;
|
||||
|
||||
if (hasData($aufenthaltsdauerRes))
|
||||
{
|
||||
$aufenthaltsdauer = getData($aufenthaltsdauerRes);
|
||||
|
||||
// check if stay >= 29 days. If yes and no ects - not resolved
|
||||
if ($aufenthaltsdauer >= 29)
|
||||
return success(false);
|
||||
else
|
||||
return success(true);
|
||||
}
|
||||
else // no Aufenthaltsdauer - not resolved
|
||||
return success(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* ZGV Datum in future
|
||||
*/
|
||||
class CORE_ZGV_0001 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['prestudent_id']) || !is_numeric($params['prestudent_id']))
|
||||
return error('Prestudent Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
// get zgvdatum of prestudent
|
||||
$this->_ci->load->model('crm/Prestudent_model', 'PrestudentModel');
|
||||
|
||||
$this->_ci->PrestudentModel->addSelect('zgvdatum');
|
||||
$prestudentRes = $this->_ci->PrestudentModel->load($params['prestudent_id']);
|
||||
|
||||
if (isError($prestudentRes))
|
||||
return $prestudentRes;
|
||||
|
||||
if (hasData($prestudentRes))
|
||||
{
|
||||
$zgvdatum = getData($prestudentRes)[0]->zgvdatum;
|
||||
|
||||
if (isEmptyString($zgvdatum))
|
||||
return success(false);
|
||||
|
||||
// check if zgvdatum comes after today
|
||||
if ($zgvdatum > date('Y-m-d'))
|
||||
return success(false);
|
||||
else
|
||||
return success(true);
|
||||
}
|
||||
else
|
||||
return success(false);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* ZGV Datum must be after Geburtsdatum
|
||||
*/
|
||||
class CORE_ZGV_0002 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['prestudent_id']) || !is_numeric($params['prestudent_id']))
|
||||
return error('Prestudent Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
// get zgvdatum of prestudent
|
||||
$this->_ci->load->model('crm/Prestudent_model', 'PrestudentModel');
|
||||
|
||||
$this->_ci->PrestudentModel->addSelect('zgvdatum, gebdatum');
|
||||
$this->_ci->PrestudentModel->addJoin('public.tbl_person', 'person_id');
|
||||
$prestudentRes = $this->_ci->PrestudentModel->load($params['prestudent_id']);
|
||||
|
||||
if (isError($prestudentRes))
|
||||
return $prestudentRes;
|
||||
|
||||
if (hasData($prestudentRes))
|
||||
{
|
||||
$prestudentData = getData($prestudentRes)[0];
|
||||
|
||||
$zgvdatum = $prestudentData->zgvdatum;
|
||||
|
||||
if (isEmptyString($zgvdatum))
|
||||
return success(false);
|
||||
|
||||
$gebdatum = $prestudentData->gebdatum;
|
||||
|
||||
if (isEmptyString($gebdatum))
|
||||
return success(false);
|
||||
|
||||
// check if zgvdatum comes before geburtsdatum
|
||||
if ($zgvdatum < $gebdatum)
|
||||
return success(false);
|
||||
else
|
||||
return success(true);
|
||||
}
|
||||
else
|
||||
return success(false);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* ZGV master Datum in future
|
||||
*/
|
||||
class CORE_ZGV_0003 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['prestudent_id']) || !is_numeric($params['prestudent_id']))
|
||||
return error('Prestudent Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
// get zgvdatum of prestudent
|
||||
$this->_ci->load->model('crm/Prestudent_model', 'PrestudentModel');
|
||||
|
||||
$this->_ci->PrestudentModel->addSelect('zgvmadatum');
|
||||
$prestudentRes = $this->_ci->PrestudentModel->load($params['prestudent_id']);
|
||||
|
||||
if (isError($prestudentRes))
|
||||
return $prestudentRes;
|
||||
|
||||
if (hasData($prestudentRes))
|
||||
{
|
||||
$zgvdatum = getData($prestudentRes)[0]->zgvmadatum;
|
||||
|
||||
if (isEmptyString($zgvdatum))
|
||||
return success(false);
|
||||
|
||||
// check if zgvdatum comes after today
|
||||
if ($zgvdatum > date('Y-m-d'))
|
||||
return success(false);
|
||||
else
|
||||
return success(true);
|
||||
}
|
||||
else
|
||||
return success(false);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* ZGV Datum should not be after ZGV master Datum
|
||||
*/
|
||||
class CORE_ZGV_0004 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['prestudent_id']) || !is_numeric($params['prestudent_id']))
|
||||
return error('Prestudent Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
// get zgvdatum of prestudent
|
||||
$this->_ci->load->model('crm/Prestudent_model', 'PrestudentModel');
|
||||
|
||||
$this->_ci->PrestudentModel->addSelect('zgvdatum, zgvmadatum');
|
||||
$prestudentRes = $this->_ci->PrestudentModel->load($params['prestudent_id']);
|
||||
|
||||
if (isError($prestudentRes))
|
||||
return $prestudentRes;
|
||||
|
||||
if (hasData($prestudentRes))
|
||||
{
|
||||
$prestudentData = getData($prestudentRes)[0];
|
||||
|
||||
// get and compare zgvdatum and zgvmadatum
|
||||
$zgvdatum = $prestudentData->zgvdatum;
|
||||
|
||||
if (isEmptyString($zgvdatum))
|
||||
return success(false);
|
||||
|
||||
$zgvmadatum = $prestudentData->zgvmadatum;
|
||||
|
||||
if (isEmptyString($zgvmadatum))
|
||||
return success(false);
|
||||
|
||||
// check if zgvmadatum comes after zgvdatum
|
||||
if ($zgvmadatum < $zgvdatum)
|
||||
return success(false);
|
||||
else
|
||||
return success(true);
|
||||
}
|
||||
else
|
||||
return success(false);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* ZGV master Datum before Geburtsdatum
|
||||
*/
|
||||
class CORE_ZGV_0005 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['prestudent_id']) || !is_numeric($params['prestudent_id']))
|
||||
return error('Prestudent Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
// get zgvdatum and geburtsdatum of prestudent
|
||||
$this->_ci->load->model('crm/Prestudent_model', 'PrestudentModel');
|
||||
|
||||
$this->_ci->PrestudentModel->addSelect('zgvmadatum, gebdatum');
|
||||
$this->_ci->PrestudentModel->addJoin('public.tbl_person', 'person_id');
|
||||
$prestudentRes = $this->_ci->PrestudentModel->load($params['prestudent_id']);
|
||||
|
||||
if (isError($prestudentRes))
|
||||
return $prestudentRes;
|
||||
|
||||
if (hasData($prestudentRes))
|
||||
{
|
||||
$prestudentData = getData($prestudentRes)[0];
|
||||
|
||||
$zgvdatum = $prestudentData->zgvmadatum;
|
||||
|
||||
if (isEmptyString($zgvdatum))
|
||||
return success(false);
|
||||
|
||||
$gebdatum = $prestudentData->gebdatum;
|
||||
|
||||
if (isEmptyString($gebdatum))
|
||||
return success(false);
|
||||
|
||||
// check if zgvdatum comes before geburtsdatum
|
||||
if ($zgvdatum < $gebdatum)
|
||||
return success(false);
|
||||
else
|
||||
return success(true);
|
||||
}
|
||||
else
|
||||
return success(false);
|
||||
}
|
||||
}
|
||||
@@ -11,4 +11,37 @@ class Bisio_model extends DB_Model
|
||||
$this->dbTable = 'bis.tbl_bisio';
|
||||
$this->pk = 'bisio_id';
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets duration of stay in days by bisio_id.
|
||||
* @param int $bisio_id
|
||||
* @return object success with number of days or error
|
||||
*/
|
||||
public function getAufenthaltsdauer($bisio_id)
|
||||
{
|
||||
// get from and to date
|
||||
$this->addSelect('von, bis');
|
||||
$bisioRes = $this->load($bisio_id);
|
||||
|
||||
if (isError($bisioRes))
|
||||
return $bisioRes;
|
||||
|
||||
if (hasData($bisioRes))
|
||||
{
|
||||
$bisioData = getData($bisioRes)[0];
|
||||
|
||||
$avon = $bisioData->von;
|
||||
$abis = $bisioData->bis;
|
||||
|
||||
if (is_null($avon) || is_null($abis))
|
||||
return success("Von or bis date not set");
|
||||
|
||||
$vonDate = new DateTime($avon);
|
||||
$bisDate = new DateTime($abis);
|
||||
$interval = $vonDate->diff($bisDate);
|
||||
return success($interval->days);
|
||||
}
|
||||
else
|
||||
return success("Bisio not found");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ class Person_model extends DB_Model
|
||||
if (!hasData($person))
|
||||
return success(null);
|
||||
|
||||
$this->KontaktModel->addSelect('kontakttyp, anmerkung, kontakt, zustellung');
|
||||
$this->KontaktModel->addSelect('kontakt_id, kontakttyp, anmerkung, kontakt, zustellung');
|
||||
$this->KontaktModel->addOrder('kontakttyp');
|
||||
$this->KontaktModel->addOrder('insertamum', 'DESC');
|
||||
$where = $zustellung_only === true ? array('person_id' => $person_id, 'zustellung' => true) : array('person_id' => $person_id);
|
||||
@@ -268,16 +268,61 @@ class Person_model extends DB_Model
|
||||
|
||||
public function checkDuplicate($person_id)
|
||||
{
|
||||
$qry = "SELECT sp.person_id
|
||||
FROM public.tbl_person p
|
||||
LEFT JOIN public.tbl_person sp ON p.vorname = sp.vorname
|
||||
AND p.nachname = sp.nachname
|
||||
AND p.gebdatum = sp.gebdatum
|
||||
JOIN public.tbl_prestudent ps ON sp.person_id = ps.person_id
|
||||
JOIN public.tbl_prestudentstatus pss ON ps.prestudent_id = pss.prestudent_id
|
||||
WHERE p.person_id = ? AND sp.person_id != ? AND pss.status_kurzbz = ?";
|
||||
$qry = "SELECT person_id
|
||||
FROM public.tbl_prestudent p
|
||||
JOIN
|
||||
(
|
||||
SELECT DISTINCT ON(prestudent_id) *
|
||||
FROM public.tbl_prestudentstatus
|
||||
WHERE prestudent_id IN
|
||||
(
|
||||
SELECT prestudent_id
|
||||
FROM public.tbl_prestudent
|
||||
WHERE person_id IN
|
||||
(
|
||||
SELECT p2.person_id
|
||||
FROM public.tbl_person p
|
||||
JOIN public.tbl_person p2
|
||||
ON p.vorname = p2.vorname
|
||||
AND p.nachname = p2.nachname
|
||||
AND p.gebdatum = p2.gebdatum
|
||||
AND p.person_id = ?
|
||||
)
|
||||
)
|
||||
ORDER BY prestudent_id, datum DESC, insertamum DESC
|
||||
) ps USING(prestudent_id)
|
||||
JOIN public.tbl_status USING(status_kurzbz)
|
||||
WHERE status_kurzbz = 'Interessent'
|
||||
AND studiengang_kz IN
|
||||
(
|
||||
SELECT studiengang_kz
|
||||
FROM public.tbl_prestudent p
|
||||
JOIN
|
||||
(
|
||||
SELECT DISTINCT ON(prestudent_id) *
|
||||
FROM public.tbl_prestudentstatus
|
||||
WHERE prestudent_id IN
|
||||
(
|
||||
SELECT prestudent_id
|
||||
FROM public.tbl_prestudent
|
||||
WHERE person_id IN
|
||||
(
|
||||
SELECT p2.person_id
|
||||
FROM public.tbl_person p
|
||||
JOIN public.tbl_person p2
|
||||
ON p.vorname = p2.vorname
|
||||
AND p.nachname = p2.nachname
|
||||
AND p.gebdatum = p2.gebdatum
|
||||
AND p.person_id = ?
|
||||
)
|
||||
)
|
||||
ORDER BY prestudent_id, datum DESC, insertamum DESC
|
||||
) ps USING(prestudent_id)
|
||||
JOIN public.tbl_status USING(status_kurzbz)
|
||||
WHERE status_kurzbz = 'Abbrecher'
|
||||
)
|
||||
";
|
||||
|
||||
|
||||
return $this->execQuery($qry, array($person_id, $person_id, 'Abbrecher'));
|
||||
return $this->execQuery($qry, array($person_id, $person_id));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,45 @@ class Issue_model extends DB_Model
|
||||
$this->pk = 'issue_id';
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets issues which are open, i.e. not resolved.
|
||||
* @param array $fehlercodes only issues for given fehler are retrieved
|
||||
* @param int $person_id
|
||||
* @param string $oe_kurzbz
|
||||
* @param string $fehlercode_extern
|
||||
* @return object success with issues or error
|
||||
*/
|
||||
public function getOpenIssues($fehlercodes, $person_id = null, $oe_kurzbz = null, $fehlercode_extern = null)
|
||||
{
|
||||
$params = array($fehlercodes);
|
||||
// issue exists for a fehlercode (or fehlercode_extern), person_id, oe_kurzbz, if not verarbeitet yet
|
||||
$qry = 'SELECT issue_id, fehlercode, inhalt, fehlercode_extern, inhalt_extern, person_id, oe_kurzbz,
|
||||
behebung_parameter, datum, verarbeitetvon, verarbeitetamum
|
||||
FROM system.tbl_issue
|
||||
WHERE fehlercode IN ?
|
||||
AND verarbeitetamum IS NULL';
|
||||
|
||||
if (!isEmptyString($fehlercode_extern))
|
||||
{
|
||||
$qry .= ' AND fehlercode_extern = ?';
|
||||
$params[] = $fehlercode_extern;
|
||||
}
|
||||
|
||||
if (isset($person_id))
|
||||
{
|
||||
$qry .= ' AND person_id = ?';
|
||||
$params[] = $person_id;
|
||||
}
|
||||
|
||||
if (isset($oe_kurzbz))
|
||||
{
|
||||
$qry .= ' AND oe_kurzbz = ?';
|
||||
$params[] = $oe_kurzbz;
|
||||
}
|
||||
|
||||
return $this->execQuery($qry, $params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets number of open (non-resolved) issues.
|
||||
* @param string $fehlercode unique error code
|
||||
|
||||
@@ -414,6 +414,10 @@
|
||||
{
|
||||
$datasetRaw->{'OnholdDate'} = '-';
|
||||
}
|
||||
else
|
||||
{
|
||||
$datasetRaw->{'OnholdDate'} = date_format(date_create($datasetRaw->{'OnholdDate'}), 'Y-m-d H:i');
|
||||
}
|
||||
|
||||
if ($datasetRaw->{'StgAbgeschickt'} == null)
|
||||
{
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
$STATUS_KURZBZ = '\'Wartender\', \'Bewerber\', \'Aufgenommener\', \'Student\'';
|
||||
$STUDIENSEMESTER = '\''.$this->variablelib->getVar('infocenter_studiensemester').'\'';
|
||||
$ORG_NAME = '\'InfoCenter\'';
|
||||
$IDENTITY = '\'identity\'';
|
||||
|
||||
$query = '
|
||||
SELECT
|
||||
@@ -245,7 +246,15 @@ $query = '
|
||||
LIMIT 1
|
||||
)
|
||||
LIMIT 1
|
||||
) AS "InfoCenterMitarbeiter"
|
||||
) AS "InfoCenterMitarbeiter",
|
||||
(
|
||||
SELECT akte.akte_id
|
||||
FROM public.tbl_akte akte
|
||||
JOIN public.tbl_dokument USING (dokument_kurzbz)
|
||||
WHERE akte.person_id = p.person_id
|
||||
AND dokument_kurzbz = '. $IDENTITY .'
|
||||
LIMIT 1
|
||||
) AS "AktenId"
|
||||
FROM public.tbl_person p
|
||||
LEFT JOIN (
|
||||
SELECT tpl.person_id,
|
||||
@@ -317,7 +326,8 @@ $query = '
|
||||
'Reihungstest date',
|
||||
'ZGV Nation BA',
|
||||
'ZGV Nation MA',
|
||||
'InfoCenter Mitarbeiter'
|
||||
'InfoCenter Mitarbeiter',
|
||||
'Identitätsnachweis'
|
||||
),
|
||||
'formatRow' => function($datasetRaw) {
|
||||
|
||||
@@ -425,6 +435,19 @@ $query = '
|
||||
$datasetRaw->{'InfoCenterMitarbeiter'} = 'Ja';
|
||||
}
|
||||
|
||||
if ($datasetRaw->{'AktenId'} !== null)
|
||||
{
|
||||
$datasetRaw->{'AktenId'} = sprintf(
|
||||
'<a href="outputAkteContent/%s">Identitätsnachweis</a>',
|
||||
$datasetRaw->{'AktenId'}
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$datasetRaw->{'AktenId'} = '-';
|
||||
}
|
||||
|
||||
|
||||
return $datasetRaw;
|
||||
},
|
||||
'markRow' => function($datasetRaw) {
|
||||
|
||||
@@ -55,7 +55,7 @@ if (isset($_GET['logout']) && $_GET['logout'] == true)
|
||||
|
||||
echo '
|
||||
<script language="Javascript">
|
||||
location = location.pathname; // clean the login.php-url from querystring
|
||||
location = "logout.html"; // clean the login.php-url from querystring
|
||||
parent.menu.location = parent.menu.location.pathname; // clean the menu.php-url from querystring
|
||||
parent.topbar.location = parent.topbar.location.pathname; // clean the topbar.php-url from querystring
|
||||
</script>
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>TestTool - FH Technikum Wien</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<link rel="stylesheet" type="text/css" href="../../vendor/twbs/bootstrap/dist/css/bootstrap.min.css">
|
||||
<link href="../../skin/style.css.php" rel="stylesheet" type="text/css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="row">
|
||||
<div class="col-xs-11">
|
||||
<div class="row" style="margin-bottom: 20px; margin-top: 3%;">
|
||||
<div class="col-xs-6 text-center" style="border-right: 1px solid lightgrey; float: left">
|
||||
<h1 style="white-space: normal">Vielen Dank für die Teilnahme an unserem Aufnahmeverfahren.</h1>
|
||||
<br/><br/>
|
||||
Die zuständige Assistenz wird sich in den nächsten Tagen bei Ihnen melden.
|
||||
<br/><br/>
|
||||
<a href="login.php" class="btn btn-default">Zurück zur Startseite</a>
|
||||
</div>
|
||||
<div class="col-xs-6 text-center" style="float: left">
|
||||
<h1 style="white-space: normal">Thank you for participating in our admission procedure.</h1>
|
||||
<br/><br/>
|
||||
The assistant in charge will contact you in the next few days.
|
||||
<br/><br/>
|
||||
<a href="login.php" class="btn btn-default">Back to startpage</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1247,15 +1247,16 @@ class reihungstest extends basis_db
|
||||
*/
|
||||
public function getReihungstestPersonDatum($prestudent_id, $datum)
|
||||
{
|
||||
$qry = "SELECT
|
||||
tbl_rt_person.*
|
||||
FROM
|
||||
public.tbl_rt_person
|
||||
JOIN public.tbl_prestudent USING(person_id)
|
||||
JOIN public.tbl_reihungstest ON(tbl_reihungstest.reihungstest_id=tbl_rt_person.rt_id)
|
||||
WHERE
|
||||
tbl_prestudent.prestudent_id = ".$this->db_add_param($prestudent_id)."
|
||||
AND tbl_reihungstest.datum=".$this->db_add_param($datum);
|
||||
$qry = "SELECT rt_person.*
|
||||
FROM tbl_prestudent ps
|
||||
JOIN tbl_prestudentstatus pss ON ps.prestudent_id = pss.prestudent_id
|
||||
JOIN tbl_rt_person rt_person ON ps.person_id = rt_person.person_id
|
||||
JOIN tbl_reihungstest rt ON rt_person.rt_id = rt.reihungstest_id
|
||||
JOIN tbl_rt_studienplan rtstp ON rt.reihungstest_id = rtstp.reihungstest_id
|
||||
WHERE ps.prestudent_id = ".$this->db_add_param($prestudent_id)."
|
||||
AND rtstp.studienplan_id = pss.studienplan_id
|
||||
AND rt.datum=".$this->db_add_param($datum);
|
||||
|
||||
if ($result = $this->db_query($qry))
|
||||
{
|
||||
while ($row = $this->db_fetch_object($result))
|
||||
|
||||
@@ -107,10 +107,12 @@ var IssuesDataset = {
|
||||
{
|
||||
successCallback: function(data, textStatus, jqXHR) {
|
||||
if (FHC_AjaxClient.isError(data))
|
||||
{
|
||||
FHC_DialogLib.alertError(
|
||||
FHC_PhrasesLib.t("fehlermonitoring", "statusAendernFehler") + ": "
|
||||
+ FHC_AjaxClient.getError(data)
|
||||
);
|
||||
}
|
||||
else if (FHC_AjaxClient.hasData(data))
|
||||
{
|
||||
FHC_FilterWidget.reloadDataset();
|
||||
|
||||
@@ -83,6 +83,16 @@ echo '<div>';
|
||||
require_once('filtersupdate.php');
|
||||
echo '</div>';
|
||||
|
||||
// ******** fehlerupdate ************/
|
||||
echo '<H2>Issues time!</H2>';
|
||||
|
||||
echo '<div>';
|
||||
echo 'fehlerupdate.php wird aufgerufen...';
|
||||
echo '</div>';
|
||||
echo '<div>';
|
||||
require_once('fehlerupdate.php');
|
||||
echo '</div>';
|
||||
|
||||
|
||||
// ******** Berechtigungen Prüfen ************/
|
||||
echo '<h2>Berechtigungen pruefen</h2>';
|
||||
|
||||
+11
-1
@@ -5955,6 +5955,16 @@ if ($result = $db->db_query("SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABL
|
||||
}
|
||||
}
|
||||
|
||||
// Add column parameterFuerBehebung to system.tbl_issue
|
||||
if(!$result = @$db->db_query("SELECT behebung_parameter FROM system.tbl_issue LIMIT 1"))
|
||||
{
|
||||
$qry = 'ALTER TABLE system.tbl_issue ADD COLUMN behebung_parameter JSONB;';
|
||||
if(!$db->db_query($qry))
|
||||
echo '<strong>system.tbl_issue: '.$db->db_last_error().'</strong><br>';
|
||||
else
|
||||
echo '<br>Added column behebung_parameter to table system.tbl_issue';
|
||||
}
|
||||
|
||||
// *** Pruefung und hinzufuegen der neuen Attribute und Tabellen
|
||||
echo '<H2>Pruefe Tabellen und Attribute!</H2>';
|
||||
|
||||
@@ -6223,7 +6233,7 @@ $tabellen=array(
|
||||
"system.tbl_fehler" => array("fehlercode","fehler_kurzbz","fehlercode_extern","fehlertext","fehlertyp_kurzbz","app"),
|
||||
"system.tbl_fehlertyp" => array("fehlertyp_kurzbz","bezeichnung_mehrsprachig"),
|
||||
"system.tbl_fehler_zustaendigkeiten" => array("fehlerzustaendigkeiten_id","fehlercode","person_id","oe_kurzbz","funktion_kurzbz"),
|
||||
"system.tbl_issue" => array("issue_id","fehlercode","fehlercode_extern","inhalt","inhalt_extern","person_id","oe_kurzbz","datum","verarbeitetvon","verarbeitetamum","status_kurzbz","insertvon","insertamum","updatevon","updateamum"),
|
||||
"system.tbl_issue" => array("issue_id","fehlercode","fehlercode_extern","inhalt","inhalt_extern","person_id","oe_kurzbz","datum","verarbeitetvon","verarbeitetamum","status_kurzbz","behebung_parameter","insertvon","insertamum","updatevon","updateamum"),
|
||||
"system.tbl_issue_status" => array("status_kurzbz","bezeichnung_mehrsprachig"),
|
||||
"system.tbl_log" => array("log_id","person_id","zeitpunkt","app","oe_kurzbz","logtype_kurzbz","logdata","insertvon","taetigkeit_kurzbz"),
|
||||
"system.tbl_logtype" => array("logtype_kurzbz", "data_schema"),
|
||||
|
||||
@@ -0,0 +1,173 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2013 FH Technikum-Wien
|
||||
*
|
||||
* 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 2 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, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
// Array of fehler to be added in the database
|
||||
$fehlerArr = array(
|
||||
array(
|
||||
'fehlercode' => 'CORE_ZGV_0001',
|
||||
'fehler_kurzbz' => 'zgvDatumInZukunft',
|
||||
'fehlercode_extern' => null,
|
||||
'fehlertext' => 'ZGV Datum in Zukunft',
|
||||
'fehlertyp_kurzbz' => 'error',
|
||||
'app' => 'core'
|
||||
),
|
||||
array(
|
||||
'fehlercode' => 'CORE_ZGV_0002',
|
||||
'fehler_kurzbz' => 'zgvDatumVorGeburtsdatum',
|
||||
'fehlercode_extern' => null,
|
||||
'fehlertext' => 'ZGV Datum vor Geburtsdatum',
|
||||
'fehlertyp_kurzbz' => 'error',
|
||||
'app' => 'core'
|
||||
),
|
||||
array(
|
||||
'fehlercode' => 'CORE_ZGV_0003',
|
||||
'fehler_kurzbz' => 'zgvMasterDatumInZukunft',
|
||||
'fehlercode_extern' => null,
|
||||
'fehlertext' => 'ZGV Masterdatum in Zukunft',
|
||||
'fehlertyp_kurzbz' => 'error',
|
||||
'app' => 'core'
|
||||
),
|
||||
array(
|
||||
'fehlercode' => 'CORE_ZGV_0004',
|
||||
'fehler_kurzbz' => 'zgvMasterDatumVorZgvdatum',
|
||||
'fehlercode_extern' => null,
|
||||
'fehlertext' => 'ZGV Masterdatum vor Zgvdatum',
|
||||
'fehlertyp_kurzbz' => 'error',
|
||||
'app' => 'core'
|
||||
),
|
||||
array(
|
||||
'fehlercode' => 'CORE_ZGV_0005',
|
||||
'fehler_kurzbz' => 'zgvMasterDatumVorGeburtsdatum',
|
||||
'fehlercode_extern' => null,
|
||||
'fehlertext' => 'ZGV Masterdatum vor Geburtsdatum',
|
||||
'fehlertyp_kurzbz' => 'error',
|
||||
'app' => 'core'
|
||||
),
|
||||
array(
|
||||
'fehlercode' => 'CORE_INOUT_0001',
|
||||
'fehler_kurzbz' => 'keinAufenthaltszweckPlausi',
|
||||
'fehlercode_extern' => null,
|
||||
'fehlertext' => 'Kein Aufenthaltszweck gefunden',
|
||||
'fehlertyp_kurzbz' => 'error',
|
||||
'app' => 'core'
|
||||
),
|
||||
array(
|
||||
'fehlercode' => 'CORE_INOUT_0002',
|
||||
'fehler_kurzbz' => 'zuVieleZweckeIncomingPlausi',
|
||||
'fehlercode_extern' => null,
|
||||
'fehlertext' => 'Es sind %s Aufenthaltszwecke eingetragen (max. 1 Zweck für Incomings)',
|
||||
'fehlertyp_kurzbz' => 'error',
|
||||
'app' => 'core'
|
||||
),
|
||||
array(
|
||||
'fehlercode' => 'CORE_INOUT_0003',
|
||||
'fehler_kurzbz' => 'falscherIncomingZweckPlausi',
|
||||
'fehlercode_extern' => null,
|
||||
'fehlertext' => 'Aufenthaltszweckcode ist %s (für Incomings ist nur Zweck 1, 2, 3 erlaubt)',
|
||||
'fehlertyp_kurzbz' => 'error',
|
||||
'app' => 'core'
|
||||
),
|
||||
array(
|
||||
'fehlercode' => 'CORE_INOUT_0004',
|
||||
'fehler_kurzbz' => 'outgoingAufenthaltfoerderungfehltPlausi',
|
||||
'fehlercode_extern' => null,
|
||||
'fehlertext' => 'Keine Aufenthaltsfoerderung angegeben (bei Outgoings >= 29 Tage Monat im Ausland muss mind. 1 gemeldet werden)',
|
||||
'fehlertyp_kurzbz' => 'error',
|
||||
'app' => 'core'
|
||||
),
|
||||
array(
|
||||
'fehlercode' => 'CORE_INOUT_0005',
|
||||
'fehler_kurzbz' => 'outgoingAngerechneteEctsFehlenPlausi',
|
||||
'fehlercode_extern' => null,
|
||||
'fehlertext' => 'Angerechnete ECTS fehlen (Meldepflicht bei Outgoings >= 29 Tage Monat im Ausland)',
|
||||
'fehlertyp_kurzbz' => 'error',
|
||||
'app' => 'core'
|
||||
),
|
||||
array(
|
||||
'fehlercode' => 'CORE_INOUT_0006',
|
||||
'fehler_kurzbz' => 'outgoingErworbeneEctsFehlenPlausi',
|
||||
'fehlercode_extern' => null,
|
||||
'fehlertext' => 'Erworbene ECTS fehlen (Meldepflicht bei Outgoings >= 29 Tage Monat im Ausland)',
|
||||
'fehlertyp_kurzbz' => 'error',
|
||||
'app' => 'core'
|
||||
)
|
||||
);
|
||||
|
||||
// Loop through the filters array
|
||||
for ($fehlerCounter = 0; $fehlerCounter < count($fehlerArr); $fehlerCounter++)
|
||||
{
|
||||
$fehler = $fehlerArr[$fehlerCounter]; // single fehler definition
|
||||
|
||||
// add optional fields
|
||||
$optional_fields = array('fehlercode_extern');
|
||||
|
||||
foreach ($optional_fields as $optional_field)
|
||||
{
|
||||
if (!array_key_exists($optional_field, $fehler))
|
||||
$fehler[$optional_field] = null;
|
||||
}
|
||||
|
||||
// If it's an array and contains the required fields
|
||||
if (is_array($fehler)
|
||||
&& isset($fehler['fehlercode']) && isset($fehler['fehler_kurzbz'])
|
||||
&& isset($fehler['fehlertext']) && isset($fehler['fehlertyp_kurzbz'])
|
||||
&& isset($fehler['app']))
|
||||
{
|
||||
$selectFehlerQuery = 'SELECT 1
|
||||
FROM system.tbl_fehler
|
||||
WHERE fehlercode = '.$db->db_add_param($fehler['fehlercode']);
|
||||
|
||||
// If no error occurred while loading a fehler from the DB
|
||||
if ($dbFehlerDefinition = @$db->db_query($selectFehlerQuery))
|
||||
{
|
||||
// If NO filters were loaded: insert
|
||||
if ($db->db_num_rows($dbFehlerDefinition) == 0)
|
||||
{
|
||||
$insertFehlerQuery = 'INSERT INTO system.tbl_fehler (
|
||||
fehlercode,
|
||||
fehler_kurzbz,
|
||||
fehlercode_extern,
|
||||
fehlertext,
|
||||
fehlertyp_kurzbz,
|
||||
app
|
||||
) VALUES (
|
||||
'.$db->db_add_param($fehler['fehlercode']).',
|
||||
'.$db->db_add_param($fehler['fehler_kurzbz']).',
|
||||
'.$db->db_add_param($fehler['fehlercode_extern']).',
|
||||
'.$db->db_add_param($fehler['fehlertext']).',
|
||||
'.$db->db_add_param($fehler['fehlertyp_kurzbz']).',
|
||||
'.$db->db_add_param($fehler['app']).'
|
||||
)';
|
||||
|
||||
if (!@$db->db_query($insertFehlerQuery)) // checks query execution
|
||||
{
|
||||
echo '<strong>An error occurred while inserting fehler: '.$db->db_last_error().'</strong><br>';
|
||||
}
|
||||
else
|
||||
{
|
||||
echo 'Fehler added: '.$fehler['fehlercode'].' - '.$fehler['fehler_kurzbz'].'<br>';
|
||||
}
|
||||
}
|
||||
}
|
||||
else // otherwise if errors occurred
|
||||
{
|
||||
echo '<strong>An error occurred while inserting fehler: '.$db->db_last_error().'</strong><br>';
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -35,12 +35,12 @@ $filters = array(
|
||||
{"name": "ZGVNation"},
|
||||
{"name": "ZGVMNation"},
|
||||
{"name": "StgAbgeschickt"},
|
||||
{"name": "Studiensemester"},
|
||||
{"name": "LastAction"},
|
||||
{"name": "LastActionType"},
|
||||
{"name": "User/Operator"},
|
||||
{"name": "InfoCenterMitarbeiter"},
|
||||
{"name": "LockUser"}
|
||||
{"name": "LockUser"},
|
||||
{"name": "OnholdDate"}
|
||||
],
|
||||
"filters": [
|
||||
{
|
||||
@@ -311,6 +311,7 @@ $filters = array(
|
||||
"columns": [
|
||||
{"name": "Vorname"},
|
||||
{"name": "Nachname"},
|
||||
{"name": "AktenId"},
|
||||
{"name": "StgAbgeschickt"},
|
||||
{"name": "LastAction"},
|
||||
{"name": "LastActionType"},
|
||||
@@ -902,9 +903,9 @@ $filters = array(
|
||||
],
|
||||
"filters": [
|
||||
{
|
||||
"name": "Fehlerstatus",
|
||||
"name": "Statuscode",
|
||||
"operation": "ncontains",
|
||||
"condition": "behoben"
|
||||
"condition": "resolved"
|
||||
},
|
||||
{
|
||||
"name": "Hauptzuständig",
|
||||
@@ -963,7 +964,8 @@ $filters = array(
|
||||
{"name": "Nachname"},
|
||||
{"name": "PersonId"},
|
||||
{"name": "Fehlerstatus"},
|
||||
{"name": "Verarbeitet von"}
|
||||
{"name": "Verarbeitet von"},
|
||||
{"name": "Verarbeitet am"}
|
||||
],
|
||||
"filters": [
|
||||
{
|
||||
@@ -973,14 +975,36 @@ $filters = array(
|
||||
"option": "days"
|
||||
},
|
||||
{
|
||||
"name": "Fehlerstatus",
|
||||
"name": "Statuscode",
|
||||
"operation": "contains",
|
||||
"condition": "behoben"
|
||||
"condition": "resolved"
|
||||
}
|
||||
]
|
||||
}
|
||||
',
|
||||
'oe_kurzbz' => null,
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'dataset_name' => 'overview',
|
||||
'filter_kurzbz' => 'DVUHStorno',
|
||||
'description' => '{DVUH Storno Übersicht}',
|
||||
'sort' => 1,
|
||||
'default_filter' => true,
|
||||
'filter' => '
|
||||
{
|
||||
"name": "DVUHStorno",
|
||||
"columns": [
|
||||
{"name": "vorname"},
|
||||
{"name": "nachname"},
|
||||
{"name": "matrikelnummer"},
|
||||
{"name": "studiengang"},
|
||||
{"name": "studiensemester"}
|
||||
],
|
||||
"filters": []
|
||||
}
|
||||
',
|
||||
'oe_kurzbz' => null,
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
@@ -896,13 +896,13 @@ $phrases = array(
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'BewerberIn bereits vorhanden',
|
||||
'text' => 'BewerberIn möglicherweise vorhanden',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'Applicant already available',
|
||||
'text' => 'Applicant maybe available',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
|
||||
@@ -675,12 +675,12 @@ if(isset($_POST['save']))
|
||||
$nachname_clean = str_replace(' ','_', $nachname_clean);
|
||||
$vorname_clean = str_replace(' ','_', $vorname_clean);
|
||||
|
||||
if (!preg_match('/^[a-z0-9-_]{3,32}$/i', $vorname_clean))
|
||||
if (!preg_match('/^[a-z0-9-_]{2,32}$/i', $vorname_clean))
|
||||
{
|
||||
$error = true;
|
||||
$errormsg = 'Im Vornamen dürfen keine Trennzeichen außer - enthalten sein!';
|
||||
}
|
||||
if (!preg_match('/^[a-z0-9-_]{4,32}$/i', $nachname_clean))
|
||||
if (!preg_match('/^[a-z0-9-_]{2,32}$/i', $nachname_clean))
|
||||
{
|
||||
$error = true;
|
||||
$errormsg = 'Im Nachnamen dürfen keine Trennzeichen außer - enthalten sein!';
|
||||
|
||||
@@ -1,189 +0,0 @@
|
||||
<?php
|
||||
/* Copyright (C) 2006 Technikum-Wien
|
||||
*
|
||||
* 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 2 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, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* Authors: Christian Paminger < christian.paminger@technikum-wien.at >
|
||||
* Andreas Oesterreicher < andreas.oesterreicher@technikum-wien.at >
|
||||
* Rudolf Hangl < rudolf.hangl@technikum-wien.at >
|
||||
* Gerald Simane-Sequens < gerald.simane-sequens@technikum-wien.at >
|
||||
*/
|
||||
|
||||
require_once('../../config/vilesci.config.inc.php');
|
||||
require_once('../../include/basis_db.class.php');
|
||||
if (!$db = new basis_db())
|
||||
die('Es konnte keine Verbindung zum Server aufgebaut werden.');
|
||||
|
||||
include('../../include/functions.inc.php');
|
||||
|
||||
foreach ($_REQUEST as $key => $value)
|
||||
{
|
||||
$key=$value;
|
||||
}
|
||||
|
||||
$type=(isset($_REQUEST['type'])?$_REQUEST['type']:'');
|
||||
|
||||
if ($type=='new')
|
||||
{
|
||||
$sql_query="INSERT INTO lektorzuteilung (lektor_id, lehrfach_id, stg_id, semester) VALUES ($lektorid,$lehrfachid,$stgid,$semester)";
|
||||
//echo $sql_query;
|
||||
if(!($result=$db->db_query($sql_query)))
|
||||
die($db->db_last_error());
|
||||
}
|
||||
|
||||
if ($type=='del')
|
||||
{
|
||||
$sql_query="DELETE FROM lektorzuteilung WHERE id=$id";
|
||||
//echo $sql_query;
|
||||
if(!($result=$db->db_query($sql_query)))
|
||||
die($db->db_last_error());
|
||||
}
|
||||
|
||||
// Daten für Lektorenauswahl
|
||||
$sql_query="SELECT id, nachname, vornamen, uid FROM lektor ORDER BY upper(nachname), vornamen, uid";
|
||||
if(!($result_lektor=$db->db_query($sql_query)))
|
||||
die($db->db_last_error());
|
||||
|
||||
|
||||
// Daten für Lehrfachauswahl
|
||||
$sql_query="SELECT id, kurzbz, bezeichnung FROM lehrfach ORDER BY kurzbz";
|
||||
if(!($result_lehrfach=$db->db_query($sql_query)))
|
||||
die($db->db_last_error());
|
||||
|
||||
|
||||
// Daten für Studiengang
|
||||
$sql_query="SELECT id, kurzbz, bezeichnung FROM studiengang ORDER BY kurzbz";
|
||||
if(!($result_stg=$db->db_query($sql_query)))
|
||||
die($db->db_last_error());
|
||||
|
||||
// Daten für die Zuteilungen
|
||||
if (!isset($order))
|
||||
$order='upper(nachname), vornamen, uid';
|
||||
$sql_query="SELECT lektorzuteilung.id, nachname, nachname, vornamen, uid, lehrfach.kurzbz AS lfkurzbz, studiengang.kurzbz AS stgkurzbz, semester";
|
||||
$sql_query.=" FROM lektorzuteilung, lektor, lehrfach, studiengang WHERE lektorzuteilung.lektor_id=lektor.id";
|
||||
$sql_query.=" AND lektorzuteilung.lehrfach_id=lehrfach.id AND lektorzuteilung.stg_id=studiengang.id ORDER BY $order";
|
||||
//echo $sql_query;
|
||||
if(!($erg=$db->db_query($sql_query)))
|
||||
die($db->db_last_error());
|
||||
$num_rows=$db->db_num_rows($erg);
|
||||
|
||||
|
||||
|
||||
$cfgBorder=1;
|
||||
$cfgThBgcolor='#CCCCCC';
|
||||
|
||||
$cfgBgcolorOne='#F4F4F4';
|
||||
$cfgBgcolorTwo='#FEFFE6';
|
||||
|
||||
?>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Zuteilung der Lektoren</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<!--<link rel="stylesheet" href="../../include/styles.css" type="text/css"> -->
|
||||
<LINK rel="stylesheet" href="../../skin/vilesci.css" type="text/css">
|
||||
</head>
|
||||
|
||||
<body class="background_main">
|
||||
<h2>Lektoren - Lehrfach Zuteilung</h2>
|
||||
Anzahl:
|
||||
<?php echo $num_rows; ?>
|
||||
<br>
|
||||
<br>
|
||||
<table border="<?php echo $cfgBorder;?>">
|
||||
<tr bgcolor="<?php echo $cfgThBgcolor; ?>">
|
||||
<th></th><th>Nachname</th><th>Vornamen</th>
|
||||
<th>uid</th>
|
||||
<th>Lehrfach</th>
|
||||
<th>Studiengang</th>
|
||||
<th>Semester</th></tr>
|
||||
<?php
|
||||
for ($i=0; $i<$num_rows; $i++)
|
||||
{
|
||||
$bgcolor = $cfgBgcolorOne;
|
||||
$i % 2 ? 0: $bgcolor = $cfgBgcolorTwo;
|
||||
|
||||
$row=$db->db_fetch_object ($erg, $i);
|
||||
|
||||
?>
|
||||
<tr bgcolor=<?php echo $bgcolor; ?>>
|
||||
<td><a href="lektorzuteilung_edit.php?id=<?php echo $row->id.'&type=del'; ?>" class="linkblue">Delete</a></td>
|
||||
<td><?php echo $row->nachname; ?></td>
|
||||
<td><?php echo $row->vornamen; ?></td>
|
||||
<td><A href="mailto:<?php echo $row->uid; ?>@technikum-wien.at" class="linkgreen"><?php echo $row->uid; ?></A></td>
|
||||
<td><?php echo $row->lfkurzbz; ?></td>
|
||||
<td><?php echo $row->stgkurzbz; ?></td>
|
||||
<td><?php echo $row->semester; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
<FORM name="newpers" method="post" action="lektorzuteilung_edit.php">
|
||||
<INPUT type="hidden" name="type" value="new">
|
||||
Lektor:
|
||||
<SELECT name="lektorid">
|
||||
<?php
|
||||
// Auswahl des Lektors
|
||||
$num_rows=$db->db_num_rows($result_lektor);
|
||||
for ($i=0;$i<$num_rows;$i++)
|
||||
{
|
||||
$row=$db->db_fetch_object ($result_lektor, $i);
|
||||
echo "<option value=\"$row->id\">$row->nachname $row->vornamen - $row->uid</option>";
|
||||
}
|
||||
?>
|
||||
</SELECT>
|
||||
<BR>
|
||||
Lehrfach:
|
||||
<SELECT name="lehrfachid">
|
||||
<?php
|
||||
// Auswahl des Lehrfach
|
||||
$num_rows=$db->db_num_rows($result_lehrfach);
|
||||
for ($i=0;$i<$num_rows;$i++)
|
||||
{
|
||||
$row=$db->db_fetch_object ($result_lehrfach, $i);
|
||||
echo "<option value=\"$row->id\">$row->kurzbz - $row->bezeichnung</option>";
|
||||
}
|
||||
?>
|
||||
</SELECT>
|
||||
<BR>
|
||||
Studiengang:
|
||||
<SELECT name="stgid">
|
||||
<?php
|
||||
// Auswahl des Lektors
|
||||
$num_rows=$db->db_num_rows($result_stg);
|
||||
for ($i=0;$i<$num_rows;$i++)
|
||||
{
|
||||
$row=$db->db_fetch_object ($result_stg, $i);
|
||||
echo "<option value=\"$row->id\">$row->kurzbz - $row->bezeichnung</option>";
|
||||
}
|
||||
?>
|
||||
</SELECT>
|
||||
Semester:
|
||||
<SELECT name="semester">
|
||||
<option value="1">1</option>
|
||||
<option value="2">2</option>
|
||||
<option value="3">3</option>
|
||||
<option value="4">4</option>
|
||||
<option value="5">5</option>
|
||||
<option value="6">6</option>
|
||||
<option value="7">7</option>
|
||||
<option value="8">8</option>
|
||||
</SELECT>
|
||||
<INPUT type="submit" name="Abschicken" value="Hinzufügen">
|
||||
</FORM>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,82 +0,0 @@
|
||||
<?php
|
||||
/* Copyright (C) 2006 Technikum-Wien
|
||||
*
|
||||
* 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 2 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, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* Authors: Christian Paminger < christian.paminger@technikum-wien.at >
|
||||
* Andreas Oesterreicher < andreas.oesterreicher@technikum-wien.at >
|
||||
* Rudolf Hangl < rudolf.hangl@technikum-wien.at >
|
||||
* Gerald Simane-Sequens < gerald.simane-sequens@technikum-wien.at >
|
||||
*/
|
||||
|
||||
require_once('../../config/vilesci.config.inc.php');
|
||||
require_once('../../include/basis_db.class.php');
|
||||
if (!$db = new basis_db())
|
||||
die('Es konnte keine Verbindung zum Server aufgebaut werden.');
|
||||
|
||||
include('../../include/functions.inc.php');
|
||||
|
||||
|
||||
if(!($erg_std=$db->db_query("SELECT * FROM stunde ORDER BY id")))
|
||||
die($db->db_last_error());
|
||||
$num_rows_std=$db->db_num_rows($erg_std);
|
||||
for ($t=1;$t<7;$t++)
|
||||
for ($i=0;$i<$num_rows_std;$i++)
|
||||
{
|
||||
$var='wunsch'.$t.'_'.$i;
|
||||
//echo $$var;
|
||||
$gewicht=$$var;
|
||||
$stunde=$i+1;
|
||||
$query="SELECT * FROM zeitwunsch WHERE lektor_id=$lkid AND stunde_id=$stunde AND tag=$t";
|
||||
if(!($erg_wunsch=$db->db_query($query)))
|
||||
die($db->db_last_error());
|
||||
$num_rows_wunsch=$db->db_num_rows($erg_wunsch);
|
||||
if ($num_rows_wunsch==0)
|
||||
{
|
||||
$query="INSERT INTO zeitwunsch (lektor_id, stunde_id, tag, gewicht) VALUES ($lkid, $stunde, $t, $gewicht)";
|
||||
if(!($erg=$db->db_query($query)))
|
||||
die($db->db_last_error());
|
||||
}
|
||||
elseif ($num_rows_wunsch==1)
|
||||
{
|
||||
$id=$db->db_result($erg_wunsch,0,"id");
|
||||
$query="UPDATE zeitwunsch SET lektor_id=$lkid, stunde_id=$stunde, tag=$t, gewicht=$gewicht WHERE id=$id";
|
||||
if(!($erg=$db->db_query($query)))
|
||||
die($db->db_last_error());
|
||||
}
|
||||
else
|
||||
die("Zuviele Eintraege fuer!");
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Profil</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<link rel="stylesheet" href="../../include/styles.css" type="text/css">
|
||||
<META http-equiv="refresh" content="2;URL=zeitwunsch.php?lkid=<?php echo $lkid.'&vornamen='.$vornamen.'&nachname='.$nachname.'&titel='.$titel; ?>">
|
||||
</head>
|
||||
|
||||
<body class="background_main">
|
||||
<h4>Zeitwünsche von
|
||||
<?php echo $titel.' '.$vornamen.' '.$nachname; ?>
|
||||
sind aktualisiert!</h4>
|
||||
<A href="zeitwunsch.php?lkid=<?php echo $lkid.'&vornamen='.$vornamen.'&nachname='.$nachname.'&titel='.$titel; ?>"><<
|
||||
Zurück</A><br>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user