Merge remote-tracking branch 'origin/master'

This commit is contained in:
Manfred Kindl
2018-07-02 13:50:34 +02:00
76 changed files with 1379 additions and 720 deletions
+1 -1
View File
@@ -58,7 +58,7 @@ $autoload['packages'] = array();
|
| $autoload['libraries'] = array('user_agent' => 'ua');
*/
$autoload['libraries'] = array('Session', 'AuthLib');
$autoload['libraries'] = array('Session');
/*
| -------------------------------------------------------------------
+4 -2
View File
@@ -90,7 +90,8 @@ $config['navigation_menu']['system/infocenter/InfoCenter/index'] = array(
'freigegeben' => array(
'link' => site_url('system/infocenter/InfoCenter/freigegeben'),
'description' => 'Freigegeben',
'icon' => 'thumbs-up'
'icon' => 'thumbs-up',
'sort' => 1
)
);
@@ -98,6 +99,7 @@ $config['navigation_menu']['system/infocenter/InfoCenter/freigegeben'] = array(
'back' => array(
'link' => site_url('system/infocenter/InfoCenter/index'),
'description' => 'Home',
'icon' => 'angle-left'
'icon' => 'angle-left',
'sort' => 1
)
);
+4 -4
View File
@@ -22,13 +22,13 @@ class MailJob extends FHC_Controller
public function __construct()
{
parent::__construct();
// Loads MessageLib
$this->load->library("MessageLib");
$this->load->library('MessageLib');
}
public function sendMessages($numberToSent = null, $numberPerTimeRange = null, $email_time_range = null, $email_from_system = null)
{
$this->messagelib->sendAll($numberToSent, $numberPerTimeRange, $email_time_range, $email_from_system);
}
}
}
-3
View File
@@ -26,9 +26,6 @@ class Redirect extends FHC_Controller
// Loads config file fhcomplete
$this->config->load('fhcomplete');
// Loads message helper
$this->load->helper('message');
// Loads model MessageTokenModel
$this->load->model('system/MessageToken_model', 'MessageTokenModel');
}
@@ -22,9 +22,6 @@ class CheckUserAuth extends APIv1_Controller
public function __construct()
{
parent::__construct();
// Loads the authentication library
$this->load->library('AuthLib');
}
/**
+5 -6
View File
@@ -16,10 +16,7 @@ if (! defined('BASEPATH'))
class AmpelMail extends FHC_Controller
{
const CIS_AMPELVERWALTUNG_URL =
CIS_ROOT. "cis/index.php?menu=".
CIS_ROOT. "cis/menu.php?content_id=&content=".
CIS_ROOT. "cis/private/tools/ampelverwaltung.php";
private $CIS_AMPELVERWALTUNG_URL;
/**
* Constructor
@@ -39,7 +36,9 @@ class AmpelMail extends FHC_Controller
echo "Jobs must be run from the CLI";
exit;
}
$this->CIS_AMPELVERWALTUNG_URL = CIS_ROOT. "cis/index.php?menu=".
CIS_ROOT. "cis/menu.php?content_id=&content=".
CIS_ROOT. "cis/private/tools/ampelverwaltung.php";
// Load models
$this->load->model('content/Ampel_model', 'AmpelModel');
$this->load->model('person/Person_model', 'PersonModel');
@@ -206,7 +205,7 @@ class AmpelMail extends FHC_Controller
'uid' => $uid,
'firstName' => $firstName,
'ampel_list' => $html_text,
'link' => self::CIS_AMPELVERWALTUNG_URL
'link' => $this->CIS_AMPELVERWALTUNG_URL
);
}
return $ampel_data_arr;
+4 -4
View File
@@ -11,7 +11,7 @@ class Basic extends CI_Controller
parent::__construct();
$this->load->library(array('rdf'));
$this->load->helper(array('form', 'url'));
$this->load->helper('form');
}
/**
@@ -25,7 +25,7 @@ class Basic extends CI_Controller
$d['content'] = $this->load->view('rdf/basic', $d, true);
$this->load->view('home', $d);
}
/**
* Load Sparql-View
* @return void
@@ -37,7 +37,7 @@ class Basic extends CI_Controller
$d['content'] = $this->load->view('rdf/basic_sparql', $d, true);
$this->load->view('home', $d);
}
/**
* Load foaf-View
* @return void
@@ -60,7 +60,7 @@ class Basic extends CI_Controller
$d['content'] = $this->load->view('rdf/foafmaker', $d, true);
$this->load->view('home', $d);
}
/**
* Load converter View
* @return void
+1 -1
View File
@@ -174,7 +174,7 @@ class Filters extends FHC_Controller
}
else
{
$this->outputJsonError('Wrong parameter');
$this->outputJsonError('An error occurred while saving a custom filter');
}
}
+3 -6
View File
@@ -16,9 +16,6 @@ class Phrases extends FHC_Controller
// Loads the widget library
$this->load->library('WidgetLib');
// Loads helper message to manage returning messages
$this->load->helper('message');
}
/**
@@ -51,7 +48,7 @@ class Phrases extends FHC_Controller
*/
public function view($phrase_id)
{
if (empty($phrase_id))
if (!is_numeric($phrase_id))
show_error('Invalid phrase_id parameter');
$phrase = $this->phraseslib->getPhrase($phrase_id);
@@ -74,7 +71,7 @@ class Phrases extends FHC_Controller
*/
public function deltext($phrasentext_id, $phrase_id)
{
if (empty($phrasentext_id) || empty($phrase_id))
if (!is_numeric($phrasentext_id) || !is_numeric($phrase_id))
show_error('Invalid phrasentext_id or phrase_id parameter');
$phrase_inhalt = $this->phraseslib->delPhrasentext($phrasentext_id);
@@ -89,7 +86,7 @@ class Phrases extends FHC_Controller
*/
public function edit($phrase_id = null)
{
if (empty($phrase_id)) return;
if (!is_numeric($phrase_id)) return;
$phrase = $this->phraseslib->getPhrase($phrase_id);
if ($phrase->error)
+25 -31
View File
@@ -2,25 +2,19 @@
if (! defined('BASEPATH')) exit('No direct script access allowed');
class UDF extends VileSci_Controller
class UDF extends VileSci_Controller
{
public function __construct()
{
parent::__construct();
// Load session library
$this->load->library('session');
// Loads the UDF library
$this->load->library('UDFLib');
//
//
$this->load->model('person/Person_model', 'PersonModel');
$this->load->model('crm/Prestudent_model', 'PrestudentModel');
}
/**
*
*
*/
public function index()
{
@@ -33,7 +27,7 @@ class UDF extends VileSci_Controller
}
unset($this->session->person_id);
}
$prestudent_id = $this->input->get('prestudent_id');
if (isset($this->session->prestudent_id))
{
@@ -43,16 +37,16 @@ class UDF extends VileSci_Controller
}
unset($this->session->prestudent_id);
}
$result = null;
if (isset($this->session->result))
{
$result = clone $this->session->result;
$this->session->set_userdata('result', null);
}
$data = array('result' => $result);
if (isset($person_id) && is_numeric($person_id))
{
if ($this->PersonModel->hasUDF())
@@ -62,7 +56,7 @@ class UDF extends VileSci_Controller
$data['personUdfs'] = $personUdfs;
}
}
if (isset($prestudent_id) && is_numeric($prestudent_id))
{
if ($this->PrestudentModel->hasUDF())
@@ -72,54 +66,54 @@ class UDF extends VileSci_Controller
$data['prestudentUdfs'] = $prestudentUdfs;
}
}
$this->load->view('system/udf', $data);
}
/**
*
*
*/
public function saveUDF()
{
$udfs = $this->input->post();
$validation = $this->_validate($udfs);
$userdata = array(
'person_id' => $udfs['person_id'],
'prestudent_id' => $udfs['prestudent_id']
'person_id' => $this->input->post('person_id'),
'prestudent_id' => $this->input->post('prestudent_id')
);
if (isSuccess($validation))
{
// Load model UDF_model
$this->load->model('system/UDF_model', 'UDFModel');
$result = $this->UDFModel->saveUDFs($udfs);
$userdata['result'] = $result;
}
else
{
$userdata['result'] = $validation;
}
$this->session->set_userdata($userdata);
redirect('system/UDF');
}
/**
*
*
*/
private function _validate($udfs)
{
$validation = error('person_id or prestudent_id is missing');
if((isset($udfs['person_id']) && !(is_null($udfs['person_id'])) && ($udfs['person_id'] != ''))
|| (isset($udfs['prestudent_id']) && !(is_null($udfs['prestudent_id'])) && ($udfs['prestudent_id'] != '')))
{
$validation = success(true);
}
return $validation;
}
}
}
+74 -74
View File
@@ -2,79 +2,79 @@
if (! defined('BASEPATH')) exit('No direct script access allowed');
class Vorlage extends VileSci_Controller
class Vorlage extends VileSci_Controller
{
public function __construct()
{
parent::__construct();
// Loads the vorlage library
$this->load->library('VorlageLib');
// Loads the widget library
$this->load->library('WidgetLib');
}
public function index()
{
$this->load->view('system/vorlage/templates.php');
}
public function table()
{
$mimetype = $this->input->post('mimetype');
if (is_null($mimetype))
$mimetype = 'text/html';
if ($mimetype == '')
$mimetype = null;
$vorlage = $this->vorlagelib->getVorlageByMimetype($mimetype);
if ($vorlage->error)
show_error($vorlage->retval);
$data = array (
'mimetype' => $mimetype,
'vorlage' => $vorlage->retval
);
$v = $this->load->view('system/vorlage/templatesList.php', $data);
}
public function view($vorlage_kurzbz = null)
{
if (empty($vorlage_kurzbz)) exit;
if (isEmptyString($vorlage_kurzbz)) exit;
$vorlagentext = $this->vorlagelib->getVorlagetextByVorlage($vorlage_kurzbz);
if ($vorlagentext->error)
show_error($vorlagentext->retval);
$data = array (
'vorlage_kurzbz' => $vorlage_kurzbz,
'vorlagentext' => $vorlagentext->retval
);
$v = $this->load->view('system/vorlage/templatetextList.php', $data);
}
public function edit($vorlage_kurzbz = null)
{
if (empty($vorlage_kurzbz)) exit;
if (isEmptyString($vorlage_kurzbz)) exit;
$vorlage = $this->vorlagelib->getVorlage($vorlage_kurzbz);
if ($vorlage->error)
show_error($vorlage->retval);
if (count($vorlage->retval) != 1)
show_error('Nachricht nicht vorhanden! ID: '.$vorlage_kurzbz);
$data = array (
'vorlage' => $vorlage->retval[0]
);
$v = $this->load->view('system/vorlage/templatesEdit', $data);
}
@@ -84,62 +84,62 @@ class Vorlage extends VileSci_Controller
'subject' => 'TestSubject',
'body' => 'TestDevelopmentBodyText'
);
$v = $this->load->view('system/vorlage/messageWrite', $data);
}
public function save()
{
$vorlage_kurzbz = $this->input->post('vorlage_kurzbz');
$data = array(
'bezeichnung' => $this->input->post('bezeichnung'),
'anmerkung' => $this->input->post('anmerkung'),
'mimetype' => $this->input->post('mimetype'),
'attribute' => $this->input->post('attribute')
);
$vorlage = $this->vorlagelib->saveVorlage($vorlage_kurzbz, $data);
if ($vorlage->error)
show_error($vorlage->retval);
$vorlage_kurzbz = $vorlage->retval;
redirect('/system/vorlage/edit/'.$vorlage_kurzbz);
}
public function newText()
{
$vorlage_kurzbz = $this->input->post('vorlage_kurzbz');
$this->load->model('organisation/Organisationseinheit_model', 'OrganisationseinheitModel');
$this->OrganisationseinheitModel->addLimit(1);
$this->OrganisationseinheitModel->addOrder('oe_kurzbz');
$resultOE = $this->OrganisationseinheitModel->loadWhere(array('aktiv' => true, 'oe_parent_kurzbz' => null));
if ($resultOE->error)
show_error($resultOE->retval);
if (hasData($resultOE))
{
$orgeinheit_kurzbz = $resultOE->retval[0]->oe_kurzbz;
$data = array (
'vorlage_kurzbz' => $vorlage_kurzbz,
'studiengang_kz' => 0,
'version' => 1,
'oe_kurzbz' => $orgeinheit_kurzbz
);
$vorlagetext = $this->vorlagelib->insertVorlagetext($data);
if ($vorlagetext->error)
show_error($vorlagetext->retval);
$vorlagestudiengang_id = $vorlagetext->retval;
redirect('/system/vorlage/editText/'.$vorlagestudiengang_id);
}
else
@@ -147,72 +147,72 @@ class Vorlage extends VileSci_Controller
show_error('No valid organisation unit found');
}
}
public function editText($vorlagestudiengang_id)
{
$vorlagetext = $this->vorlagelib->getVorlagetextById($vorlagestudiengang_id);
if ($vorlagetext->error)
show_error($vorlagetext->retval);
$data = $vorlagetext->retval[0];
// Preview-Data
$schema = $this->vorlagelib->getVorlage($data->vorlage_kurzbz);
$data->schema = $schema->retval[0]->attribute;
$this->load->view('system/vorlage/templatetextEdit', $data);
}
public function linkDocuments($vorlagestudiengang_id)
{
$data = array();
$this->load->model('system/Vorlagedokument_model', 'VorlagedokumentModel');
$return = $this->VorlagedokumentModel->loadDokumenteFromVorlagestudiengang($vorlagestudiengang_id);
$data['documents'] = $return->retval;
$this->load->model('system/Dokument_model', 'DokumentModel');
$this->DokumentModel->addOrder('bezeichnung');
$return = $this->DokumentModel->load();
$data['allDocuments'] = $return->retval;
$data['vorlagestudiengang_id'] = $vorlagestudiengang_id;
$this->load->view('system/vorlage/templateLinkDocuments', $data);
}
public function saveDocuments($vorlagestudiengang_id, $dokument_kurzbz, $sort)
{
$insert = array();
$insert['vorlagestudiengang_id'] = $vorlagestudiengang_id;
$insert['dokument_kurzbz'] = $dokument_kurzbz;
$insert['sort'] = $sort;
$this->load->model('system/Vorlagedokument_model', 'VorlagedokumentModel');
$this->VorlagedokumentModel->insert($insert);
}
public function deleteDocumentLink($vorlagestudiengang_id)
{
$this->load->model('system/Vorlagedokument_model', 'VorlagedokumentModel');
$this->VorlagedokumentModel->delete($vorlagestudiengang_id);
}
public function changeSort($vorlagestudiengang_id, $sort)
{
$this->load->model('system/Vorlagedokument_model', 'VorlagedokumentModel');
$this->VorlagedokumentModel->update($vorlagestudiengang_id, array('sort' => $sort));
}
public function saveText()
{
$data = array(
@@ -223,38 +223,38 @@ class Vorlage extends VileSci_Controller
'text' => $this->input->post('text'),
'vorlagestudiengang_id' => $this->input->post('vorlagestudiengang_id')
);
if ($this->input->post('sprache') == '')
$data['sprache'] = null;
else
$data['sprache'] = $this->input->post('sprache');
if ($this->input->post('orgform_kurzbz') == '')
$data['orgform_kurzbz'] = null;
else
$data['orgform_kurzbz'] = $this->input->post('orgform_kurzbz');
$vorlagetext = $this->vorlagelib->updateVorlagetext($data['vorlagestudiengang_id'], $data);
if ($vorlagetext->error)
show_error($vorlagetext->retval);
redirect('/system/vorlage/editText/'.$data['vorlagestudiengang_id']);
}
public function preview($vorlagestudiengang_id)
{
$jsonDecodedForm = json_decode($this->input->post('formdata'), true);
$vorlagetext = $this->vorlagelib->getVorlagetextById($vorlagestudiengang_id);
if ($vorlagetext->error)
show_error($vorlagetext->retval);
$data = array(
'text' => $this->vorlagelib->parseVorlagetext($vorlagetext->retval[0]->text, $jsonDecodedForm)
);
$this->load->view('system/vorlage/templatetextPreview', $data);
}
}
}
@@ -7,14 +7,11 @@ class PrestudentMultiAssign extends VileSci_Controller
public function __construct()
{
parent::__construct();
// Loads helper message to manage returning messages
$this->load->helper('message');
// Loads the widget library
$this->load->library('WidgetLib');
}
public function index()
{
$studiengang = $this->input->post('studiengang');
@@ -22,27 +19,27 @@ class PrestudentMultiAssign extends VileSci_Controller
$aufnahmegruppe = $this->input->post('aufnahmegruppe');
$reihungstest = $this->input->post('reihungstest');
$stufe = $this->input->post('stufe');
// Converts string 'null' to a null value
$stufe = ($stufe == 'null' ? null : $stufe);
$studiengang = ($studiengang == 'null' ? null : $studiengang);
$reihungstest = ($reihungstest == 'null' ? null : $reihungstest);
$aufnahmegruppe = ($aufnahmegruppe == 'null' ? null : $aufnahmegruppe);
$studiensemester = ($studiensemester == 'null' ? null : $studiensemester);
$returnUsers = null;
if ($studiengang != null || $studiensemester != null || $aufnahmegruppe!= null
|| $reihungstest != null || $stufe != null)
{
$returnUsers = $this->_getPrestudents($studiengang, $studiensemester, $aufnahmegruppe, $reihungstest, $stufe);
}
$users = null;
if (hasData($returnUsers))
{
$users = $returnUsers->retval;
}
if ($returnUsers == null || isSuccess($returnUsers))
{
$viewData = array(
@@ -53,7 +50,7 @@ class PrestudentMultiAssign extends VileSci_Controller
'stufe' => $stufe,
'users' => $users
);
$this->load->view('system/aufnahme/prestudentMultiAssign', $viewData);
}
else if (isError($returnUsers))
@@ -61,7 +58,7 @@ class PrestudentMultiAssign extends VileSci_Controller
show_error($returnUsers->retval);
}
}
/**
* To assign a stufe to one or more prestudents
*/
@@ -69,16 +66,16 @@ class PrestudentMultiAssign extends VileSci_Controller
{
$prestudentIdArray = $this->input->post('prestudent_id');
$stufe = $this->input->post('stufe');
// Converts string 'null' to a null value
$stufe = ($stufe == 'null' ? null : $stufe);
// Load model PrestudentstatusModel
$this->load->model('crm/Prestudentstatus_model', 'PrestudentstatusModel');
// Set the HTTP header
$this->output->set_header('Content-Type: application/json; charset=utf-8');
$result = error("No valid parameters");
if (isset($stufe)
&& isset($prestudentIdArray)
@@ -86,7 +83,7 @@ class PrestudentMultiAssign extends VileSci_Controller
&& count($prestudentIdArray) > 0)
{
$result = $this->PrestudentstatusModel->updateStufe($prestudentIdArray, $stufe);
if (isSuccess($result))
{
echo '{"msg": "Data correctly saved"}';
@@ -101,7 +98,7 @@ class PrestudentMultiAssign extends VileSci_Controller
echo '{"msg": "'.$result->retval.'"}';
}
}
/**
* To assign one or more prestudents to a gruppe
*/
@@ -109,16 +106,16 @@ class PrestudentMultiAssign extends VileSci_Controller
{
$prestudentIdArray = $this->input->post('prestudent_id');
$aufnahmegruppe = $this->input->post('aufnahmegruppe');
// Converts string 'null' to a null value
$aufnahmegruppe = ($aufnahmegruppe == 'null' ? null : $aufnahmegruppe);
// Load model PrestudentstatusModel
$this->load->model('crm/Prestudent_model', 'PrestudentModel');
// Set the HTTP header
$this->output->set_header('Content-Type: application/json; charset=utf-8');
$result = error("No valid parameters");
if (isset($aufnahmegruppe)
&& isset($prestudentIdArray)
@@ -126,7 +123,7 @@ class PrestudentMultiAssign extends VileSci_Controller
&& count($prestudentIdArray) > 0)
{
$result = $this->PrestudentModel->updateAufnahmegruppe($prestudentIdArray, $aufnahmegruppe);
if (isSuccess($result))
{
echo '{"msg": "Data correctly saved"}';
@@ -141,7 +138,7 @@ class PrestudentMultiAssign extends VileSci_Controller
echo '{"msg": "'.$result->retval.'"}';
}
}
/**
* Get the prestudents using search parameters
*/
@@ -149,32 +146,32 @@ class PrestudentMultiAssign extends VileSci_Controller
{
// Load model prestudentm_model
$this->load->model('crm/Prestudent_model', 'PrestudentModel');
if ($studiengang == '' || empty($studiengang))
if ($studiengang == '' || isEmptyString($studiengang))
{
$studiengang = null;
}
if ($studiensemester == '' || empty($studiensemester))
if ($studiensemester == '' || isEmptyString($studiensemester))
{
$studiensemester = null;
}
if ($aufnahmegruppe == '' || empty($aufnahmegruppe))
if ($aufnahmegruppe == '' || isEmptyString($aufnahmegruppe))
{
$aufnahmegruppe = null;
}
if ($reihungstest == '' || empty($reihungstest))
if ($reihungstest == '' || isEmptyString($reihungstest))
{
$reihungstest = null;
}
if ($stufe == '' || empty($stufe))
if ($stufe == '' || isEmptyString($stufe))
{
$stufe = null;
}
return $this->PrestudentModel->getPrestudentMultiAssign(
$studiengang,
$studiensemester,
@@ -183,4 +180,4 @@ class PrestudentMultiAssign extends VileSci_Controller
$stufe
);
}
}
}
@@ -15,7 +15,7 @@ class Manager extends VileSci_Controller
parent::__construct();
// Load helpers to upload files
$this->load->helper(array('form', 'url'));
$this->load->helper('form');
// Loads the extensions library
$this->load->library('ExtensionsLib');
@@ -144,8 +144,8 @@ class InfoCenter extends FHC_Controller
if (isError($personexists))
show_error($personexists->retval);
if (empty($personexists->retval))
show_error('person does not exist!');
if (!hasData($personexists))
show_error('Person does not exist!');
$origin_page = $this->input->get(self::ORIGIN_PAGE);
if ($origin_page == self::INDEX_PAGE)
@@ -213,7 +213,7 @@ class InfoCenter extends FHC_Controller
$person_id,
'saveformalgep',
array(
empty($akte->retval[0]->titel) ? $akte->retval[0]->bezeichnung : $akte->retval[0]->titel,
isEmptyString($akte->retval[0]->titel) ? $akte->retval[0]->bezeichnung : $akte->retval[0]->titel,
is_null($timestamp) ? 'NULL' : $timestamp
)
);
@@ -269,7 +269,7 @@ class InfoCenter extends FHC_Controller
{
$prestudent_id = $this->input->post('prestudentid');
if (empty($prestudent_id))
if (isEmptyString($prestudent_id))
$result = error('Prestudentid missing');
else
{
@@ -278,14 +278,14 @@ class InfoCenter extends FHC_Controller
$zgv_code = $this->input->post('zgv') === 'null' ? null : $this->input->post('zgv');
$zgvort = $this->input->post('zgvort');
$zgvdatum = $this->input->post('zgvdatum');
$zgvdatum = empty($zgvdatum) ? null : date_format(date_create($zgvdatum), 'Y-m-d');
$zgvdatum = isEmptyString($zgvdatum) ? null : date_format(date_create($zgvdatum), 'Y-m-d');
$zgvnation_code = $this->input->post('zgvnation') === 'null' ? null : $this->input->post('zgvnation');
//zgvmasterdata
$zgvmas_code = $this->input->post('zgvmas') === 'null' ? null : $this->input->post('zgvmas');
$zgvmaort = $this->input->post('zgvmaort');
$zgvmadatum = $this->input->post('zgvmadatum');
$zgvmadatum = empty($zgvmadatum) ? null : date_format(date_create($zgvmadatum), 'Y-m-d');
$zgvmadatum = isEmptyString($zgvmadatum) ? null : date_format(date_create($zgvmadatum), 'Y-m-d');
$zgvmanation_code = $this->input->post('zgvmanation') === 'null' ? null : $this->input->post('zgvmanation');
$result = $this->PrestudentModel->update(
@@ -692,7 +692,12 @@ class InfoCenter extends FHC_Controller
'#', // link
array(), // children
'', // icon
true // expand
true, // expand
null, // subscriptDescription
null, // subscriptLinkClass
null, // subscriptLinkValue
'', // target
1 // sort
);
$filtersArray['nichtabgeschickt'] = $this->navigationlib->oneLevel(
@@ -700,7 +705,12 @@ class InfoCenter extends FHC_Controller
'#', // link
array(), // children
'', // icon
true // expand
true, // expand
null, // subscriptDescription
null, // subscriptLinkClass
null, // subscriptLinkValue
'', // target
2 // sort
);
$this->_fillFilters($listFiltersSent, $filtersArray['abgeschickt']);
@@ -713,7 +723,12 @@ class InfoCenter extends FHC_Controller
'#', // link
array(), // children
'', // icon
true // expand
true, // expand
null, // subscriptDescription
null, // subscriptLinkClass
null, // subscriptLinkValue
'', // target
3 // sort
);
$this->_fillCustomFilters($listCustomFilters, $filtersArray['personal']);
@@ -726,7 +741,12 @@ class InfoCenter extends FHC_Controller
'#', // link
$filtersArray, // children
'', // icon
true // expand
true, // expand
null, // subscriptDescription
null, // subscriptLinkClass
null, // subscriptLinkValue
'', // target
10 // sort
)
)
);
@@ -750,11 +770,16 @@ class InfoCenter extends FHC_Controller
$this->navigationlib->setSessionMenu(
array(
'back' => $this->navigationlib->oneLevel(
'<< Züruck', // description
'Zurück', // description
$link, // link
array(), // children
'', // icon
true // expand
'angle-left', // icon
true, // expand
null, // subscriptDescription
null, // subscriptLinkClass
null, // subscriptLinkValue
'', // target
1 // sort
)
)
);
@@ -804,7 +829,12 @@ class InfoCenter extends FHC_Controller
'#', // link
array(), // children
'', // icon
true // expand
true, // expand
null, // subscriptDescription
null, // subscriptLinkClass
null, // subscriptLinkValue
'', // target
15 // sort
);
$this->_fillCustomFilters($listCustomFilters, $filtersArray['children']['personal']);
@@ -817,7 +847,12 @@ class InfoCenter extends FHC_Controller
'#', // link
$filtersArray['children'], // children
'', // icon
true // expand
true, // expand
null, // subscriptDescription
null, // subscriptLinkClass
null, // subscriptLinkValue
'', // target
10 // sort
)
)
);
@@ -1158,9 +1193,9 @@ class InfoCenter extends FHC_Controller
$orgform = $prestudentstatus->orgform != '' ? ' ('.$prestudentstatus->orgform.')' : '';
$geschlecht = $person->geschlecht == 'm' ? 'm&auml;nnlich' : 'weiblich';
$geburtsdatum = date('d.m.Y', strtotime($person->gebdatum));
$zgvort = !empty($prestudent->zgvort) ? ' in '.$prestudent->zgvort : '';
$zgvnation = !empty($prestudent->zgvnation_bez) ? ', '.$prestudent->zgvnation_bez : '';
$zgvdatum = !empty($prestudent->zgvdatum) ? ', am '.date_format(date_create($prestudent->zgvdatum), 'd.m.Y') : '';
$zgvort = !isEmptyString($prestudent->zgvort) ? ' in '.$prestudent->zgvort : '';
$zgvnation = !isEmptyString($prestudent->zgvnation_bez) ? ', '.$prestudent->zgvnation_bez : '';
$zgvdatum = !isEmptyString($prestudent->zgvdatum) ? ', am '.date_format(date_create($prestudent->zgvdatum), 'd.m.Y') : '';
$dokumenteNachzureichenMail = $dokumenteMail = array();
//convert documents to array so they can be parsed, and keeping only needed fields
@@ -1173,8 +1208,8 @@ class InfoCenter extends FHC_Controller
foreach ($dokumenteNachzureichen as $dokument)
{
$anmerkung = !empty($dokument->anmerkung) ? ' | Anmerkung: '.$dokument->anmerkung : '';
$nachgereichtam = !empty($dokument->nachgereicht_am) ? ' | wird nachgereicht bis '.date_format(date_create($dokument->nachgereicht_am), 'd.m.Y') : '';
$anmerkung = !isEmptyString($dokument->anmerkung) ? ' | Anmerkung: '.$dokument->anmerkung : '';
$nachgereichtam = !isEmptyString($dokument->nachgereicht_am) ? ' | wird nachgereicht bis '.date_format(date_create($dokument->nachgereicht_am), 'd.m.Y') : '';
$dokumenteNachzureichenMail[] = array('dokument_bezeichnung' => $dokument->dokument_bezeichnung, 'anmerkung' => $anmerkung, 'nachgereicht_am' => $nachgereichtam);
}
@@ -1235,7 +1270,7 @@ class InfoCenter extends FHC_Controller
$receiver = $prestudent->studiengangmail;
if (!empty($receiver))
if (!isEmptyString($receiver))
{
//Freigabeinformationmail sent from default system mail to studiengang mail(s)
$sent = $this->maillib->send('', $receiver, $subject, $email, '', null, null, 'Bitte sehen Sie sich die Nachricht in HTML Sicht an, um den Inhalt vollständig darzustellen.');
+5 -2
View File
@@ -10,10 +10,13 @@ class APIv1_Controller extends REST_Controller
public function __construct()
{
parent::__construct();
// Loads helper fhcauth to manage the authentication
$this->load->helper('fhcauth');
// Loads return messages
$this->load->helper('message');
log_message('debug', 'Called API: '.$_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING']);
}
}
+4 -4
View File
@@ -484,9 +484,9 @@ class DB_Model extends FHC_Model
$tmpTable = trim($table);
// Check parameters
if (empty($tmpTable)) return error(FHC_MODEL_ERROR, FHC_MODEL_ERROR);
if (isEmptyString($tmpTable)) return error(FHC_MODEL_ERROR, FHC_MODEL_ERROR);
if (!empty($alias))
if (!isEmptyString($alias))
{
$tmpTable .= ' AS '.$alias;
}
@@ -586,7 +586,7 @@ class DB_Model extends FHC_Model
$result = array();
// String that represents the pgsql array, better if not empty
if (!empty($string))
if (!isEmptyString($string))
{
// Magic convertion
preg_match_all(
@@ -742,7 +742,7 @@ class DB_Model extends FHC_Model
$result = null;
// If the query is empty don't lose time
if (!empty($query))
if (!isEmptyString($query))
{
// If there are parameters to bind to the query
if (is_array($parametersArray) && count($parametersArray) > 0)
+15 -2
View File
@@ -9,7 +9,10 @@ class FHC_Controller extends CI_Controller
private $_controllerId; // contains the unique identifier of a call to a controller
/**
* Standard construct for all the controllers, loads the authentication system
* Standard construct for all the controllers
* - initialize the object properties
* - loads the authentication system
* - loads all the helpers that later are always needed
*/
public function __construct()
{
@@ -17,7 +20,17 @@ class FHC_Controller extends CI_Controller
$this->_controllerId = null; // set _controllerId as null by default
// Loads helper fhcauth to manage the authentication
$this->load->helper('fhcauth');
// Loads helper message to manage returning messages
$this->load->helper('message');
// Loads helper with generic utility function
$this->load->helper('fhc');
// Loads helper session to manage the php session
$this->load->helper('session');
}
//------------------------------------------------------------------------------------------------------------------
@@ -48,7 +61,7 @@ class FHC_Controller extends CI_Controller
{
$this->_controllerId = $this->input->get(self::FHC_CONTROLLER_ID);
if (!isset($this->_controllerId) || empty($this->_controllerId))
if (!isset($this->_controllerId) || isEmptyString($this->_controllerId))
{
$this->_controllerId = uniqid(); // generate a unique id
// Redirect to the same URL, but giving FHC_CONTROLLER_ID as HTTP GET parameter
-3
View File
@@ -17,9 +17,6 @@ class FHC_Model extends CI_Model
$this->lang->load('fhc_model');
$this->lang->load('fhcomplete');
// Load return message helper
$this->load->helper('message');
// Loads the permission library
$this->load->library('PermissionLib');
}
+12 -15
View File
@@ -10,16 +10,13 @@ class FS_Model extends FHC_Model
public function __construct($filepath = null)
{
parent::__construct();
// Load the filesystem library
$this->load->library('FilesystemLib');
// Load return message helper
$this->load->helper('message');
$this->filepath = $filepath;
}
/** ---------------------------------------------------------------
* Read data from file system
*
@@ -29,13 +26,13 @@ class FS_Model extends FHC_Model
{
// Check Class-Attributes
if (is_null($this->filepath)) return error(FHC_MODEL_ERROR, FHC_ERROR);
// Check method parameters
if (is_null($filename)) return error(FHC_MODEL_ERROR, FHC_ERROR);
// Check rights
if (isError($ent = $this->isEntitled($this->filepath, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent;
if (!is_null($data = $this->filesystemlib->read($this->filepath, $filename)))
{
return success(base64_encode($data));
@@ -45,7 +42,7 @@ class FS_Model extends FHC_Model
return error(FHC_MODEL_ERROR, FHC_ERROR);
}
}
/** ---------------------------------------------------------------
* Writing data to file system
*
@@ -56,7 +53,7 @@ class FS_Model extends FHC_Model
{
// Check Class-Attributes
if (is_null($this->filepath)) return error(FHC_MODEL_ERROR, FHC_ERROR);
// Check method parameters
if (is_null($filename)) return error(FHC_MODEL_ERROR, FHC_ERROR);
if (is_null($content)) return error(FHC_MODEL_ERROR, FHC_ERROR);
@@ -84,7 +81,7 @@ class FS_Model extends FHC_Model
{
// Check Class-Attributes
if (is_null($this->filepath)) return error(FHC_MODEL_ERROR, FHC_ERROR);
// Check method parameters
if (is_null($content)) return error(FHC_MODEL_ERROR, FHC_ERROR);
if (is_null($filename)) return error(FHC_MODEL_ERROR, FHC_ERROR);
@@ -112,7 +109,7 @@ class FS_Model extends FHC_Model
{
// Check Class-Attributes
if (is_null($this->filepath)) return error(FHC_MODEL_ERROR, FHC_ERROR);
// Check method parameters
if (is_null($filename)) return error(FHC_MODEL_ERROR, FHC_ERROR);
@@ -128,7 +125,7 @@ class FS_Model extends FHC_Model
return error(FHC_MODEL_ERROR, FHC_ERROR);
}
}
/** ---------------------------------------------------------------
* Rename a file
*
@@ -139,11 +136,11 @@ class FS_Model extends FHC_Model
{
// Check Class-Attributes
if (is_null($this->filepath)) return error(FHC_MODEL_ERROR, FHC_ERROR);
// Check method parameters
if (is_null($filename)) return error(FHC_MODEL_ERROR, FHC_ERROR);
if (is_null($newFilename)) return error(FHC_MODEL_ERROR, FHC_ERROR);
// Check rights
if (isError($ent = $this->isEntitled($this->filepath, PermissionLib::UPDATE_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent;
+19
View File
@@ -148,3 +148,22 @@ function loadResource($path, $resources = null, $subdir = false)
}
}
}
/**
* Returns true if the given string is empty
* Empty means that the parameter string is null or made of space, tab, vertical tab, line feed, carriage return
* and form feed characters.
*/
function isEmptyString($string)
{
return ($string == null) || ($string != null && ctype_space($string) === true);
}
/**
* Returns true if the given array is empty
* Empty means that is null, or is not null and it is not an array, or it is an array but without elements
*/
function isEmptyArray($array)
{
return ($array == null) || ($array != null && !is_array($array) || (is_array($array) && count($array) == 0));
}
+1 -1
View File
@@ -61,7 +61,7 @@ if ( ! function_exists('auth'))
function getAuthUID()
{
$ci =& get_instance(); // get CI instance
$ci->load->library('AuthLib'); // load session library
$ci->load->library('AuthLib'); // load authentication library
return $ci->authlib->getUser();
}
+4 -4
View File
@@ -35,7 +35,7 @@ function sendMail($vorlage_kurzbz, $vorlage_data, $to, $subject, $headerImg = DE
$ci =& get_instance();
$ci->load->library('email');
$ci->load->library('MailLib');
$sanchoHeader_img = 'skin/images/sancho/'. $headerImg;
$sanchoFooter_img = 'skin/images/sancho/sancho_footer.jpg';
@@ -49,7 +49,7 @@ function sendMail($vorlage_kurzbz, $vorlage_data, $to, $subject, $headerImg = DE
// Set specific mail content into specific content template
$content = _parseMailContent($vorlage_kurzbz, $vorlage_data);
// overall main content data array
$layout = array(
'CID_header' => $cid_header,
@@ -75,14 +75,14 @@ function _parseMailContent($vorlage_kurzbz, $vorlage_data)
{
$ci =& get_instance();
$ci->load->library('VorlageLib');
$result = $ci->vorlagelib->getVorlagetextByVorlage($vorlage_kurzbz);
if (isSuccess($result))
{
// If the text and the subject of the template are not empty
if (is_array($result->retval) && count($result->retval) > 0 &&
!empty($result->retval[0]->text))
!isEmptyString($result->retval[0]->text))
{
// Parses template text
$parsedText = $ci->vorlagelib->parseVorlagetext($result->retval[0]->text, $vorlage_data);
+9 -10
View File
@@ -27,6 +27,8 @@ require_once FHCPATH.'include/authentication.class.php';
class AuthLib extends authentication
{
private $_ci; // CI instance
/**
* Construct
*/
@@ -35,10 +37,7 @@ class AuthLib extends authentication
parent::__construct();
// Gets CI instance
$this->ci =& get_instance();
// Loads helper message to manage returning messages
$this->ci->load->helper('Message');
$this->_ci =& get_instance();
}
/**
@@ -83,9 +82,9 @@ class AuthLib extends authentication
$result = error(false);
// Load model PersonModel
$this->ci->load->model('person/person_model', 'PersonModel');
$this->_ci->load->model('person/person_model', 'PersonModel');
$person = $this->ci->PersonModel->loadWhere(array('zugangscode' => $code));
$person = $this->_ci->PersonModel->loadWhere(array('zugangscode' => $code));
if (hasData($person))
{
@@ -103,9 +102,9 @@ class AuthLib extends authentication
$result = error(false);
// Load model PersonModel
$this->ci->load->model('person/person_model', 'PersonModel');
$this->_ci->load->model('person/person_model', 'PersonModel');
$person = $this->ci->PersonModel->getPersonKontaktByZugangscode($code, $email);
$person = $this->_ci->PersonModel->getPersonKontaktByZugangscode($code, $email);
if (hasData($person))
{
@@ -124,9 +123,9 @@ class AuthLib extends authentication
$finalUserBasicDataByUID = null;
// Load model BenutzerModel
$this->ci->load->model('person/Benutzer_model', 'BenutzerModel');
$this->_ci->load->model('person/Benutzer_model', 'BenutzerModel');
$benutzer = $this->ci->BenutzerModel->load($uid);
$benutzer = $this->_ci->BenutzerModel->load($uid);
if (hasData($benutzer))
{
-3
View File
@@ -33,9 +33,6 @@ class CallerLib
// Gets CI instance
$this->ci =& get_instance();
// Loads helper message to manage returning messages
$this->ci->load->helper('Message');
// Loads permission library
$this->ci->load->library('PermissionLib');
}
-3
View File
@@ -17,9 +17,6 @@ class DmsLib
$this->ci->load->model('content/Dms_model', 'DmsModel');
$this->ci->load->model('content/DmsVersion_model', 'DmsVersionModel');
$this->ci->load->model('content/DmsFS_model', 'DmsFSModel');
// Loads helper message to manage returning messages
$this->ci->load->helper('message');
}
/**
+1 -1
View File
@@ -733,7 +733,7 @@ class ExtensionsLib
);
if (!$_addSoftLinks)
{
log_message('error','Failed to create Symlink to '.$extensionPath.$targetDirectory);
log_message('error', 'Failed to create Symlink to '.$extensionPath.$targetDirectory);
break;
}
}
+12 -18
View File
@@ -80,11 +80,6 @@ class FiltersLib
{
$this->_ci =& get_instance(); // get code igniter instance
// Loads helper message to manage returning messages
$this->_ci->load->helper('message');
// Loads helper session to manage the php session
$this->_ci->load->helper('session');
$this->_filterUniqueId = $this->_getFilterUniqueId($params); // sets the id for the related filter widget
}
@@ -243,7 +238,7 @@ class FiltersLib
$datasetQuery = 'SELECT * FROM ('.$query.') '.self::DATASET_TABLE_ALIAS;
// If the given query is valid and the parameter filters is an array
if (!empty(trim($query)) && $filters != null && is_array($filters))
if (!isEmptyString($query) && $filters != null && is_array($filters))
{
$where = ''; // starts building the SQL where clause
@@ -254,7 +249,7 @@ class FiltersLib
if ($filtersCounter > 0) $where .= ' AND '; // if it's NOT the last one
if (!empty(trim($filterDefinition->name))) // if the name of the applied filter is valid
if (!isEmptyString($filterDefinition->name)) // if the name of the applied filter is valid
{
// ...build the condition
$where .= '"'.$filterDefinition->name.'"'.$this->_getDatasetQueryCondition($filterDefinition);
@@ -296,13 +291,13 @@ class FiltersLib
$filterName = $filterJson->name; // always present, used as default
// Filter name from phrases system
if (isset($filterJson->namePhrase) && !empty(trim($filterJson->namePhrase)))
if (isset($filterJson->namePhrase) && !isEmptyString($filterJson->namePhrase))
{
// Loads the library to use the phrases system
$this->_ci->load->library('PhrasesLib', array(self::FILTER_PHRASES_CATEGORY));
$tmpFilterNamePhrase = $this->_ci->phraseslib->t(self::FILTER_PHRASES_CATEGORY, $filterJson->namePhrase);
if (isset($tmpFilterNamePhrase) && !empty(trim($tmpFilterNamePhrase))) // if is not null or an empty string
if (isset($tmpFilterNamePhrase) && !isEmptyString($tmpFilterNamePhrase)) // if is not null or an empty string
{
$filterName = $tmpFilterNamePhrase;
}
@@ -344,7 +339,7 @@ class FiltersLib
$removeSelectedField = false;
// Checks the parameter selectedField
if (isset($selectedField) && !empty(trim($selectedField)))
if (isset($selectedField) && !isEmptyString($selectedField))
{
// Retrives all the used fields by the current filter
$fields = $this->getElementSession(self::SESSION_FIELDS);
@@ -378,7 +373,7 @@ class FiltersLib
$removeSelectedField = false;
// Checks the parameter selectedField
if (isset($selectedField) && !empty(trim($selectedField)))
if (isset($selectedField) && !isEmptyString($selectedField))
{
// Retrives all the used fields by the current filter
$fields = $this->getElementSession(self::SESSION_FIELDS);
@@ -407,7 +402,7 @@ class FiltersLib
$removeAppliedFilter = false;
// Checks the parameter appliedFilter
if (isset($appliedFilter) && !empty(trim($appliedFilter)))
if (isset($appliedFilter) && !isEmptyString($appliedFilter))
{
// Retrives all the used fields by the current filter
$fields = $this->getElementSession(self::SESSION_FIELDS);
@@ -495,7 +490,7 @@ class FiltersLib
$addFilter = false;
// Checks the parameter filter
if (isset($filter) && !empty(trim($filter)))
if (isset($filter) && !isEmptyString($filter))
{
// Retrives all the used fields by the current filter
$fields = $this->getElementSession(self::SESSION_FIELDS);
@@ -538,7 +533,7 @@ class FiltersLib
$saveCustomFilter = false; // by default returns a failure
// Checks parameter customFilterDescription if not valid stop the execution
if (!isset($customFilterDescription) || empty(trim($customFilterDescription)))
if (!isset($customFilterDescription) || isEmptyString($customFilterDescription))
{
return $saveCustomFilter;
}
@@ -655,11 +650,10 @@ class FiltersLib
*/
private function _getFilterUniqueId($params)
{
//
if ($params != null
&& is_array($params)
&& isset($params[self::FILTER_PAGE_PARAM])
&& !empty(trim($params[self::FILTER_PAGE_PARAM])))
&& !isEmptyString($params[self::FILTER_PAGE_PARAM]))
{
$filterUniqueId = $params[self::FILTER_PAGE_PARAM];
}
@@ -691,7 +685,7 @@ class FiltersLib
$condition = ''; // starts building the condition
// "operation" is a required property for the applied filter definition
if (!empty(trim($filterDefinition->operation)))
if (!isEmptyString($filterDefinition->operation))
{
// Checks what operation is required
switch ($filterDefinition->operation)
@@ -766,7 +760,7 @@ class FiltersLib
}
// if the condition is valid
if (!empty(trim($condition))) $condition = ' '.$condition; // add a white space before
if (!isEmptyString($condition)) $condition = ' '.$condition; // add a white space before
return $condition;
}
+2 -2
View File
@@ -88,7 +88,7 @@ class MailLib
if (!is_null($recipientBCC)) $this->ci->email->bcc($recipientBCC);
$this->ci->email->subject($subject);
$this->ci->email->message($message);
if (!empty($altMessage)) $this->ci->email->set_alt_message($altMessage);
if (!isEmptyString($altMessage)) $this->ci->email->set_alt_message($altMessage);
// Avoid printing on standard output ugly error messages
$result = @$this->ci->email->send();
@@ -151,7 +151,7 @@ class MailLib
{
$valid = false;
if (!empty($emailAddress))
if (!isEmptyString($emailAddress))
{
$valid = filter_var($emailAddress, FILTER_VALIDATE_EMAIL);
}
+14 -19
View File
@@ -35,11 +35,6 @@ class MessageLib
$this->ci->load->model('system/Recipient_model', 'RecipientModel');
$this->ci->load->model('system/Attachment_model', 'AttachmentModel');
// Loads fhc helper
$this->ci->load->helper('fhc');
// Loads helper message to manage returning messages
$this->ci->load->helper('message');
// Loads phrases
$this->ci->lang->load('message');
}
@@ -49,9 +44,9 @@ class MessageLib
*/
public function getMessage($msg_id, $person_id)
{
if (empty($msg_id))
if (!is_numeric($msg_id))
return $this->_error('', MSG_ERR_INVALID_MSG_ID);
if (empty($person_id))
if (!is_numeric($person_id))
return $this->_error('', MSG_ERR_INVALID_RECIPIENTS);
$msg = $this->ci->RecipientModel->getMessage($msg_id, $person_id);
@@ -64,7 +59,7 @@ class MessageLib
*/
public function getMessagesByUID($uid, $oe_kurzbz = null, $all = false)
{
if (empty($uid))
if (isEmptyString($uid))
return $this->_error('', MSG_ERR_INVALID_MSG_ID);
$msg = $this->ci->RecipientModel->getMessagesByUID($uid, $oe_kurzbz, $all);
@@ -77,7 +72,7 @@ class MessageLib
*/
public function getMessagesByPerson($person_id, $oe_kurzbz = null, $all = false)
{
if (empty($person_id))
if (!is_numeric($person_id))
return $this->_error('', MSG_ERR_INVALID_MSG_ID);
$msg = $this->ci->RecipientModel->getMessagesByPerson($person_id, $oe_kurzbz, $all);
@@ -90,7 +85,7 @@ class MessageLib
*/
public function getSentMessagesByPerson($person_id, $oe_kurzbz = null, $all = false)
{
if (empty($person_id))
if (!is_numeric($person_id))
return $this->_error('', MSG_ERR_INVALID_MSG_ID);
$msg = $this->ci->MessageModel->getMessagesByPerson($person_id, $oe_kurzbz, $all);
@@ -103,7 +98,7 @@ class MessageLib
*/
public function getMessageByToken($token)
{
if (empty($token))
if (isEmptyString($token))
return $this->_error('', MSG_ERR_INVALID_TOKEN);
$result = $this->ci->RecipientModel->getMessageByToken($token);
@@ -160,12 +155,12 @@ class MessageLib
*/
public function updateMessageStatus($message_id, $person_id, $status)
{
if (empty($message_id))
if (!is_numeric($message_id))
{
return $this->_error('', MSG_ERR_INVALID_MSG_ID);
}
if (empty($person_id))
if (!is_numeric($person_id))
{
return $this->_error('', MSG_ERR_INVALID_USER_ID);
}
@@ -227,7 +222,7 @@ class MessageLib
if ($this->_checkReceiverId($receiver_id))
{
// If the text and the subject of the template are not empty
if (!empty($subject) && !empty($body))
if (!isEmptyString($subject) && !isEmptyString($body))
{
$result = $this->_saveMessage($sender_id, $receiver_id, $subject, $body, $relationmessage_id, $oe_kurzbz);
// If no errors were occurred
@@ -244,12 +239,12 @@ class MessageLib
}
else
{
if (empty($subject))
if (isEmptyString($subject))
{
$result = $this->_error('', MSG_ERR_SUBJECT_EMPTY);
break;
}
elseif (empty($body))
elseif (isEmptyString($body))
{
$result = $this->_error('', MSG_ERR_BODY_EMPTY);
break;
@@ -320,7 +315,7 @@ class MessageLib
{
// If the text and the subject of the template are not empty
if (is_array($result->retval) && count($result->retval) > 0 &&
!empty($result->retval[0]->text) && !empty($result->retval[0]->subject))
!isEmptyString($result->retval[0]->text) && !isEmptyString($result->retval[0]->subject))
{
// Parses template text
$parsedText = $this->ci->vorlagelib->parseVorlagetext($result->retval[0]->text, $data);
@@ -354,12 +349,12 @@ class MessageLib
$result = $this->_error('', MSG_ERR_TEMPLATE_NOT_FOUND);
break;
}
elseif (empty($result->retval[0]->text))
elseif (isEmptyString($result->retval[0]->text))
{
$result = $this->_error('', MSG_ERR_INVALID_TEMPLATE);
break;
}
elseif (empty($result->retval[0]->subject))
elseif (isEmptyString($result->retval[0]->subject))
{
$result = $this->_error('', MSG_ERR_INVALID_TEMPLATE);
break;
+66 -108
View File
@@ -32,11 +32,6 @@ class NavigationLib
// Loads navigation configs
$this->_ci->config->load('navigation');
// Loads helper message to manage returning messages
$this->_ci->load->helper('message');
// Loads helper session to manage the php session
$this->_ci->load->helper('session');
// Loads library ExtensionsLib
$this->_ci->load->library('ExtensionsLib');
@@ -47,114 +42,23 @@ class NavigationLib
// Public methods
/**
* Creates the left Menu for each Page
* @param navigation_widget_called GET Parameter witch holds the currently called Page
* Creates the left menu for each Page
* @param navigationPage GET Parameter witch holds the currently called Page
* @return array with the Menu Entries
*/
public function getMenuArray($navigationPage)
{
$menuArray = array();
if (isset($navigationPage))
{
// Get Menu Entries of the Core
$navigationMenuArray = $this->_ci->config->item(self::CONFIG_MENU_NAME);
$menuArray = $this->_wildcardsearch($navigationMenuArray, $navigationPage);
// Load Menu Entries of Extensions
$extensions = $this->_ci->extensionslib->getInstalledExtensions();
if(hasData($extensions))
{
$json_extension = array();
foreach($extensions->retval as $ext)
{
$filename = APPPATH.'config/'.ExtensionsLib::EXTENSIONS_DIR_NAME.'/'.$ext->name.'/'.self::CONFIG_NAVIGATION_FILENAME;
if (file_exists($filename))
{
unset($config);
include($filename);
if(isset($config[self::CONFIG_MENU_NAME]) && is_array($config[self::CONFIG_MENU_NAME]))
{
$json_extension = array_merge_recursive(
$json_extension,
$this->_wildcardsearch($config[self::CONFIG_MENU_NAME],
$navigationPage)
);
}
}
}
// Merge Extension Menuentries with the Core Entries
$menuArray = array_merge_recursive($menuArray, $json_extension);
}
// Load dynamic Menu Entries from Session
if (($navigationMenuSessionArray = $this->getSessionMenu()) != null)
{
if (isset($navigationMenuSessionArray) && is_array($navigationMenuSessionArray))
{
$menuArray = array_merge_recursive($menuArray, $navigationMenuSessionArray);
}
}
}
$this->_sortArray($menuArray);
return $menuArray;
return $this->_getNavigationArray($navigationPage, self::CONFIG_MENU_NAME, $this->getSessionMenu());
}
/**
* Creates the Top Menu for each Page
* @param navigation_widget_called GET Parameter witch holds the currently called Page
* Creates the header menu for each Page
* @param navigationPage GET Parameter witch holds the currently called Page
* @return array with the Menu Entries
*/
public function getHeaderArray($navigationPage)
{
$headerArray = array();
if (isset($navigationPage))
{
// Load Header Entries of Core
$navigationHeaderArray = $this->_ci->config->item(self::CONFIG_HEADER_NAME);
$headerArray = $this->_wildcardsearch($navigationHeaderArray, $navigationPage);
// Load Header Entries of Extensions
$extensions = $this->_ci->extensionslib->getInstalledExtensions();
if(hasData($extensions))
{
$headerArray_extension = array();
foreach($extensions->retval as $ext)
{
$filename = APPPATH.'config/'.ExtensionsLib::EXTENSIONS_DIR_NAME.'/'.$ext->name.'/'.self::CONFIG_NAVIGATION_FILENAME;
if (file_exists($filename))
{
unset($config);
include($filename);
if(isset($config[self::CONFIG_HEADER_NAME]) && is_array($config[self::CONFIG_HEADER_NAME]))
{
$headerArray_extension = array_merge_recursive(
$json_extension,
$this->_wildcardsearch($config[self::CONFIG_HEADER_NAME],
$navigationPage)
);
}
}
}
$headerArray = array_merge_recursive($headerArray, $headerArray_extension);
}
// Load dynamic Header Entries from Session
if (($navigationHeaderSessionArray = $this->getSessionHeader()) != null)
{
if (isset($navigationHeaderSessionArray) && is_array($navigationHeaderSessionArray))
{
$headerArray = array_merge_recursive($headerArray, $navigationHeaderSessionArray);
}
}
}
$this->_sortArray($headerArray);
return $headerArray;
return $this->_getNavigationArray($navigationPage, self::CONFIG_HEADER_NAME, $this->getSessionHeader());
}
/**
@@ -292,6 +196,61 @@ class NavigationLib
//------------------------------------------------------------------------------------------------------------------
// Private methods
/**
* Build the array needed by the NavigationWidget to render the left menu or the header
* menu depending on the given parameters
* @param navigationPage GET Parameter witch holds the currently called Page
* @param configName the name of the navigation config entry
* @param sessionArray array present in the session that could contains other menu entries
* @return array with the Menu Entries
*/
private function _getNavigationArray($navigationPage, $configName, $sessionArray)
{
$navigationArray = array();
if (isset($navigationPage))
{
// Load Header Entries of Core
$configArray = $this->_ci->config->item($configName);
$navigationArray = $this->_wildcardsearch($configArray, $navigationPage);
// Load Header Entries of Extensions
$extensions = $this->_ci->extensionslib->getInstalledExtensions();
if (hasData($extensions))
{
$extensionArray = array();
foreach ($extensions->retval as $ext)
{
$filename = APPPATH.'config/'.ExtensionsLib::EXTENSIONS_DIR_NAME.'/'.$ext->name.'/'.self::CONFIG_NAVIGATION_FILENAME;
if (file_exists($filename))
{
unset($config);
include($filename);
if (isset($config[$configName]) && is_array($config[$configName]))
{
$extensionArray = array_merge_recursive(
$extensionArray,
$this->_wildcardsearch($config[$configName],
$navigationPage)
);
}
}
}
$navigationArray = array_merge_recursive($navigationArray, $extensionArray);
}
// Load dynamic header entries from session
if ($sessionArray != null && is_array($sessionArray))
{
$navigationArray = array_merge_recursive($navigationArray, $sessionArray);
}
}
$this->_sortArray($navigationArray);
return $navigationArray;
}
/**
* Searches a Menuentry. If there is no exact entry it searches for Wildcard Entries with a Star
* Example:
@@ -311,20 +270,20 @@ class NavigationLib
krsort($navigationArray);
// 100% match found
if(isset($navigationArray[$navigationPage]))
if (isset($navigationArray[$navigationPage]))
{
return $navigationArray[$navigationPage];
}
else
{
foreach($navigationArray as $key=>$row)
foreach ($navigationArray as $key=>$row)
{
// Search for * Entries
if(mb_strpos($key, '*') === 0 || mb_strpos($key, '*') === mb_strlen($key) - 1)
if (mb_strpos($key, '*') === 0 || mb_strpos($key, '*') === mb_strlen($key) - 1)
{
// Take * Entry if Matches
$search = mb_substr($key, 0, -1);
if($search == '' || mb_strpos($navigationPage, $search) === 0)
if ($search == '' || mb_strpos($navigationPage, $search) === 0)
{
return $row;
}
@@ -341,11 +300,10 @@ class NavigationLib
*/
private function _getNavigationtPage($params)
{
//
if ($params != null
&& is_array($params)
&& isset($params[self::NAVIGATION_PAGE_PARAM])
&& !empty(trim($params[self::NAVIGATION_PAGE_PARAM])))
&& !isEmptyString($params[self::NAVIGATION_PAGE_PARAM]))
{
$navigationPage = $params[self::NAVIGATION_PAGE_PARAM];
}
@@ -13,9 +13,6 @@ class OrganisationseinheitLib
// Loads model Organisationseinheit_model
$this->ci->load->model('organisation/Organisationseinheit_model', 'OrganisationseinheitModel');
// Loads helper message to manage returning messages
$this->ci->load->helper('Message');
}
/**
+8 -9
View File
@@ -30,6 +30,7 @@ class PermissionLib
const DELETE_RIGHT = 'd';
const REPLACE_RIGHT = 'ui';
private $_ci; // CI instance
private $acl; // conversion array from a source to a permission
private static $bb; // benutzerberechtigung
@@ -40,22 +41,20 @@ class PermissionLib
public function __construct()
{
// Loads CI instance
$this->ci =& get_instance();
// Loads the library to manage the rights system
//$this->ci->load->library('FHC_DB_ACL');
// Loads the auth helper
$this->ci->load->helper('fhcauth');
$this->_ci =& get_instance();
// Loads the array of resources
$this->acl = $this->ci->config->item('fhc_acl');
$this->acl = $this->_ci->config->item('fhc_acl');
// Loads authentication library
$this->_ci->load->library('AuthLib');
// If it's NOT called from command line
if (!is_cli())
{
// API Caller rights initialization
self::$bb = new benutzerberechtigung();
self::$bb->getBerechtigungen(getAuthUID());
self::$bb->getBerechtigungen($this->_ci->authlib->getUser());
}
}
+8 -11
View File
@@ -22,9 +22,6 @@ class PhrasesLib
$this->_ci->load->model('system/Phrase_model', 'PhraseModel');
$this->_ci->load->model('system/Phrasentext_model', 'PhrasentextModel');
// Loads helper message to manage returning messages
$this->_ci->load->helper('message');
// Workaround to use more parameters in the construct since PHP doesn't support many constructors
$this->_extend_construct(func_get_args());
}
@@ -37,7 +34,7 @@ class PhrasesLib
*/
public function getPhrase($phrase_id)
{
if (empty($phrase_id)) return error(MSG_ERR_INVALID_MSG_ID);
if (isEmptyString($phrase_id)) return error(MSG_ERR_INVALID_MSG_ID);
return $this->_ci->PhraseModel->load($phrase_id);
}
@@ -55,7 +52,7 @@ class PhrasesLib
*/
public function getPhraseInhalt($phrase_id)
{
if (empty($phrase_id)) return error(MSG_ERR_INVALID_MSG_ID);
if (isEmptyString($phrase_id)) return error(MSG_ERR_INVALID_MSG_ID);
return $this->_ci->PhrasentextModel->loadWhere(array('phrase_id' => $phrase_id));
}
@@ -65,7 +62,7 @@ class PhrasesLib
*/
public function delPhrasentext($phrasentext_id)
{
if (empty($phrasentext_id)) return error(MSG_ERR_INVALID_MSG_ID);
if (isEmptyString($phrasentext_id)) return error(MSG_ERR_INVALID_MSG_ID);
return $this->_ci->PhrasentextModel->delete(array('phrasentext_id' => $phrasentext_id));
}
@@ -75,7 +72,7 @@ class PhrasesLib
*/
public function savePhrase($phrase_id, $data)
{
if (empty($data)) return error(MSG_ERR_INVALID_MSG_ID);
if (isEmptyString($data)) return error(MSG_ERR_INVALID_MSG_ID);
return $this->_ci->PhraseModel->update($phrase_id, $data);
}
@@ -85,7 +82,7 @@ class PhrasesLib
*/
public function getPhrasentextById($phrasentext_id)
{
if (empty($phrasentext_id))
if (isEmptyString($phrasentext_id))
return error($this->_ci->lang->line('fhc_'.FHC_INVALIDID, false));
return $this->_ci->PhrasentextModel->load($phrasentext_id);
@@ -173,7 +170,7 @@ class PhrasesLib
*/
public function parseVorlagetext($text, $data = array())
{
if (empty($text))
if (isEmptyString($text))
return error($this->_ci->lang->line('fhc_'.FHC_INVALIDID, false));
return $this->_ci->parser->parse_string($text, $data, true);
@@ -202,7 +199,7 @@ class PhrasesLib
&& $_phrase->phrase == $phrase
&& $_phrase->orgeinheit_kurzbz == $orgeinheit_kurzbz
&& $_phrase->orgform_kurzbz == $orgform_kurzbz
&& (!empty(trim($_phrase->text))))
&& !isEmptyString($_phrase->text))
{
if (!is_array($parameters)) $parameters = array(); // if params is not an array
@@ -246,7 +243,7 @@ class PhrasesLib
// Use the given language if present, otherwise retrives the language for the logged user
$language = DEFAULT_LANGUAGE;
if (count($parameters) == 2 && !empty($parameters[1]) && is_string($parameters[1]))
if (count($parameters) == 2 && !isEmptyString($parameters[1]) && is_string($parameters[1]))
{
$language = $parameters[1];
}
@@ -1814,6 +1814,9 @@ abstract class REST_Controller extends CI_Controller {
return FALSE;
}
// Loads authentication library
$this->load->library('AuthLib');
if (is_callable([$auth_library_class, $auth_library_function]) === FALSE)
{
$this->load->library($auth_library_class);
+5 -6
View File
@@ -53,8 +53,6 @@ class UDFLib
public function __construct()
{
$this->_ci =& get_instance();
$this->_ci->load->helper('fhc');
}
// -------------------------------------------------------------------------------------------------
@@ -65,7 +63,8 @@ class UDFLib
*/
public function UDFWidget($args, $htmlArgs = array())
{
if (!empty($args[UDFLib::SCHEMA_ARG_NAME]) && !empty($args[UDFLib::TABLE_ARG_NAME]))
if ((isset($args[UDFLib::SCHEMA_ARG_NAME]) && !isEmptyString($args[UDFLib::SCHEMA_ARG_NAME]))
&& (isset($args[UDFLib::TABLE_ARG_NAME]) && !isEmptyString($args[UDFLib::TABLE_ARG_NAME])))
{
// Loads the widget library
$this->_ci->load->library('WidgetLib');
@@ -74,7 +73,7 @@ class UDFLib
loadResource(APPPATH.'widgets/udf');
// Default external block is true
if (empty($args[UDFLib::FIELD_ARG_NAME]) && !isset($htmlArgs[HTMLWidget::EXTERNAL_BLOCK]))
if (!isset($args[UDFLib::FIELD_ARG_NAME]) && !isset($htmlArgs[HTMLWidget::EXTERNAL_BLOCK]))
{
$htmlArgs[HTMLWidget::EXTERNAL_BLOCK] = true;
}
@@ -87,11 +86,11 @@ class UDFLib
}
else
{
if (empty($args[UDFLib::SCHEMA_ARG_NAME]))
if (!isset($args[UDFLib::SCHEMA_ARG_NAME]) || isEmptyString($args[UDFLib::SCHEMA_ARG_NAME]))
{
show_error(UDFLib::SCHEMA_ARG_NAME.' parameter is missing!');
}
if (empty($args[UDFLib::TABLE_ARG_NAME]))
if (!isset($args[UDFLib::TABLE_ARG_NAME]) || isEmptyString($args[UDFLib::TABLE_ARG_NAME]))
{
show_error(UDFLib::TABLE_ARG_NAME.' parameter is missing!');
}
+5 -10
View File
@@ -20,11 +20,6 @@ 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('message');
//$this->ci->lang->load('fhcomplete');
}
/**
@@ -35,7 +30,7 @@ class VorlageLib
*/
public function getVorlage($vorlage_kurzbz)
{
if (empty($vorlage_kurzbz))
if (isEmptyString($vorlage_kurzbz))
return error(MSG_ERR_INVALID_MSG_ID);
$vorlage = $this->ci->VorlageModel->load($vorlage_kurzbz);
@@ -62,7 +57,7 @@ class VorlageLib
*/
public function saveVorlage($vorlage_kurzbz, $data)
{
if (empty($data))
if (isEmptyArray($data))
return error(MSG_ERR_INVALID_MSG_ID);
$vorlage = $this->ci->VorlageModel->update($vorlage_kurzbz, $data);
@@ -77,7 +72,7 @@ class VorlageLib
*/
public function getVorlagetextByVorlage($vorlage_kurzbz)
{
if (empty($vorlage_kurzbz))
if (isEmptyString($vorlage_kurzbz))
return error($this->ci->lang->line('fhc_'.FHC_INVALIDID, false));
$vorlage = $this->ci->VorlageStudiengangModel->loadWhere(array('vorlage_kurzbz' => $vorlage_kurzbz));
@@ -95,7 +90,7 @@ class VorlageLib
*/
public function loadVorlagetext($vorlage_kurzbz, $oe_kurzbz = null, $orgform_kurzbz = null, $sprache = null)
{
if (empty($vorlage_kurzbz))
if (isEmptyString($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
@@ -205,7 +200,7 @@ class VorlageLib
*/
public function parseVorlagetext($text, $data = array())
{
if (empty($text))
if (isEmptyString($text))
return error($this->ci->lang->line('fhc_'.FHC_INVALIDID, false));
$text = $this->ci->parser->parse_string($text, $data, true);
return $text;
+84 -88
View File
@@ -4,17 +4,17 @@
* @author Jens Segers
* @link http://www.jenssegers.be
* @license MIT License Copyright (c) 2012 Jens Segers
*
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -30,16 +30,16 @@ class WidgetLib
{
const DIR_HTML_WIDGETS = 'html';
const HTML_WIDGET_NAME = 'HTMLWidget';
/* default values */
private $_template = 'template';
private $_parser = false;
private $_cache_ttl = 0;
private $_widget_path = '';
private $_ci;
private $_partials = array();
/**
* Construct with configuration array. Codeigniter will use the config file otherwise
* @param array $config
@@ -47,23 +47,19 @@ class WidgetLib
public function __construct($config = array())
{
$this->_ci = & get_instance();
$this->_ci->load->helper('fhc');
// Set the default widget path with APPPATH
$this->_widget_path = APPPATH.'widgets/';
// Loads widgets to render HTML elements
// NOTE: the first one to be loaded must be HTMLWidget
loadResource($this->_widget_path.WidgetLib::DIR_HTML_WIDGETS, WidgetLib::HTML_WIDGET_NAME);
loadResource($this->_widget_path.WidgetLib::DIR_HTML_WIDGETS);
if (!empty($config))
$this->initialize($config);
log_message('debug', 'Template library initialized');
// If config are given then initialize this lib with the given config
if (!isEmptyArray($config)) $this->initialize($config);
}
/**
* Initialize with configuration array
* @param array $config
@@ -73,14 +69,14 @@ class WidgetLib
{
foreach ($config as $key => $val)
$this->{'_'.$key} = $val;
if ($this->_widget_path == '')
$this->_widget_path = APPPATH.'widgets/';
if ($this->_parser && !class_exists('CI_Parser'))
$this->_ci->load->library('parser');
}
/**
* Set a partial's content. This will create a new partial when not existing
* @param string $index
@@ -90,7 +86,7 @@ class WidgetLib
{
$this->partial($name)->set($value);
}
/**
* Access to partials for method chaining
* @param string $name
@@ -100,7 +96,7 @@ class WidgetLib
{
return $this->partial($name);
}
/**
* Check if a partial exists
* @param string $index
@@ -110,7 +106,7 @@ class WidgetLib
{
return array_key_exists($index, $this->_partials);
}
/**
* Set the template file
* @param string $template
@@ -119,7 +115,7 @@ class WidgetLib
{
$this->_template = $template;
}
/**
* Publish the template with the current partials
* You can manually pass a template file with extra data, or use the default template from the config file
@@ -136,12 +132,12 @@ class WidgetLib
{
$this->_template = $template;
}
if (!$this->_template)
{
show_error('There was no template file selected for the current template');
}
if (is_array($data) || is_object($data))
{
foreach ($data as $name => $content)
@@ -149,9 +145,9 @@ class WidgetLib
$this->partial($name)->set($content);
}
}
unset($data);
if ($this->_parser)
{
$this->_ci->parser->parse($this->_template, $this->_partials);
@@ -161,7 +157,7 @@ class WidgetLib
$this->_ci->load->view($this->_template, $this->_partials);
}
}
/**
* Create a partial object with an optional default content
* Can be usefull to use straight from the template file
@@ -183,24 +179,24 @@ class WidgetLib
{
$partial->cache($this->_cache_ttl);
}
// detect local triggers
if (method_exists($this, 'trigger_'.$name))
{
$partial->bind($this, 'trigger_'.$name);
}
$this->_partials[$name] = $partial;
}
if (!$partial->content() && $default)
{
$partial->set($default);
}
return $partial;
}
/**
* Create a widget object with optional parameters
* Can be usefull to use straight from the template file
@@ -213,15 +209,15 @@ class WidgetLib
{
// Loads the widget file, trying to find it also in the subdirectories
loadResource($this->_widget_path, $name, true);
if (!class_exists($name))
{
show_error("Widget '".$name."' was not found.");
}
return new $name($name, $data, $htmlArgs);
}
/**
* Enable cache for all partials with TTL, default TTL is 60
* @param int $ttl
@@ -233,10 +229,10 @@ class WidgetLib
{
$partial->cache($ttl, $identifier);
}
$this->_cache_ttl = $ttl;
}
// ---- TRIGGERS -----------------------------------------------------------------
/**
@@ -255,27 +251,27 @@ class WidgetLib
}
return $return;
}
if (!stristr($url, 'http://') && !stristr($url, 'https://') && substr($url, 0, 2) != '//')
{
$url = $this->_ci->config->item('base_url').$url;
}
// legacy support for media
if (is_string($attributes))
{
$attributes = array('media' => $attributes);
}
if (is_array($attributes))
{
$attributeString = "";
foreach ($attributes as $key => $value)
{
$attributeString .= $key.'="'.$value.'" ';
}
return '<link rel="stylesheet" href="'.htmlspecialchars(strip_tags($url)).'" '.$attributeString.'>'."\n\t";
}
else
@@ -283,7 +279,7 @@ class WidgetLib
return '<link rel="stylesheet" href="'.htmlspecialchars(strip_tags($url)).'">'."\n\t";
}
}
/**
* Javascript trigger
* @param string $source
@@ -300,15 +296,15 @@ class WidgetLib
}
return $return;
}
if (!stristr($url, 'http://') && !stristr($url, 'https://') && substr($url, 0, 2) != '//')
{
$url = $this->_ci->config->item('base_url').$url;
}
return '<script src="'.htmlspecialchars(strip_tags($url)).'"></script>'."\n\t";
}
/**
* Meta trigger
* @param string $name
@@ -319,12 +315,12 @@ class WidgetLib
{
$name = htmlspecialchars(strip_tags($name));
$value = htmlspecialchars(strip_tags($value));
if ($name == 'keywords' and !strpos($value, ','))
{
$content = preg_replace('/[\s]+/', ', ', trim($value));
}
switch ($type)
{
case 'meta' :
@@ -334,10 +330,10 @@ class WidgetLib
$content = '<link rel="'.$name.'" href="'.$value.'">'."\n\t";
break;
}
return $content;
}
/**
* Title trigger, keeps it clean
* @param string $name
@@ -348,7 +344,7 @@ class WidgetLib
{
return htmlspecialchars(strip_tags($title));
}
/**
* Title trigger, keeps it clean
* @param string $name
@@ -366,7 +362,7 @@ class Partial
{
protected $_ci, $_content, $_name, $_cache_ttl = 0, $_cached = false, $_identifier, $_trigger;
protected $_args = array();
/**
* Construct with optional parameters
* @param array $args
@@ -377,7 +373,7 @@ class Partial
$this->_args = $args;
$this->_name = $name;
}
/**
* Gives access to codeigniter's functions from this class if needed
* This will be handy in extending classes
@@ -387,7 +383,7 @@ class Partial
{
return $this->_ci->$name;
}
/**
* Alias methods
*/
@@ -403,7 +399,7 @@ class Partial
break;
}
}
/**
* Returns the content when converted to a string
* @return string
@@ -412,7 +408,7 @@ class Partial
{
return (string) $this->content();
}
/**
* Returns the content
* @return string
@@ -423,10 +419,10 @@ class Partial
{
$this->cache->save($this->cache_id(), $this->_content, $this->_cache_ttl);
}
return $this->_content;
}
/**
* Overwrite the content
* @param mixed $content
@@ -438,10 +434,10 @@ class Partial
{
$this->_content = (string) $this->trigger(func_get_args());
}
return $this;
}
/**
* Append something to the content
* @param mixed $content
@@ -453,10 +449,10 @@ class Partial
{
$this->_content .= (string) $this->trigger(func_get_args());
}
return $this;
}
/**
* Prepend something to the content
* @param mixed $content
@@ -468,10 +464,10 @@ class Partial
{
$this->_content = (string) $this->trigger(func_get_args()).$this->_content;
}
return $this;
}
/**
* Set content if partial is empty
* @param mixed $default
@@ -486,10 +482,10 @@ class Partial
$this->_content = $default;
}
}
return $this;
}
/**
* Load a view inside this partial, overwrite if wanted
* @param string $view
@@ -511,9 +507,9 @@ class Partial
}
$data = $array;
}
$content = $this->_ci->load->view($view, $data, true);
if ($overwrite)
{
$this->set($content);
@@ -525,7 +521,7 @@ class Partial
}
return $this;
}
/**
* Parses a view inside this partial, overwrite if wanted
* @param string $view
@@ -541,7 +537,7 @@ class Partial
{
$this->_ci->load->library('parser');
}
// better object to array
if (is_object($data))
{
@@ -552,9 +548,9 @@ class Partial
}
$data = $array;
}
$content = $this->_ci->parser->parse($view, $data, true);
if ($overwrite)
{
$this->set($content);
@@ -564,10 +560,10 @@ class Partial
$this->append($content);
}
}
return $this;
}
/**
* Loads a widget inside this partial, overwrite if wanted
* @param string $name
@@ -580,7 +576,7 @@ class Partial
if (!$this->_cached)
{
$widget = $this->template->widget($name, $data);
if ($overwrite)
{
$this->set($widget->content());
@@ -592,7 +588,7 @@ class Partial
}
return $this;
}
/**
* Enable cache with TTL, default TTL is 60
* @param int $ttl
@@ -604,10 +600,10 @@ class Partial
{
$this->_ci->load->driver('cache', array('adapter' => 'file'));
}
$this->_cache_ttl = $ttl;
$this->_identifier = $identifier;
if ($cached = $this->_ci->cache->get($this->cache_id()))
{
$this->_cached = true;
@@ -615,7 +611,7 @@ class Partial
}
return $this;
}
/**
* Used for cache identification
* @return string
@@ -631,7 +627,7 @@ class Partial
return $this->_name.'_'.md5(get_class($this).implode('', $this->_args));
}
}
/**
* Trigger returns the result if a trigger is set
* @param array $args
@@ -648,7 +644,7 @@ class Partial
return call_user_func_array($this->_trigger, $args);
}
}
/**
* Bind a trigger function
* Can be used like bind($this, "function") or bind("function")
@@ -663,12 +659,12 @@ class Partial
$args = func_get_args();
$obj = array_shift($args);
$func = array_pop($args);
foreach ($args as $trigger)
{
$obj = $obj->$trigger;
}
$this->_trigger = array($obj, $func);
}
else
@@ -703,8 +699,8 @@ class Widget extends Partial
ob_start();
$this->display($this->_args);
$buffer = ob_get_clean();
// if no content is produced but there was direct ouput we set
// if no content is produced but there was direct ouput we set
// that output as content
if (!$this->_content && $buffer)
{
@@ -712,7 +708,7 @@ class Widget extends Partial
}
}
}
return parent::content();
}
}
}
+3 -3
View File
@@ -32,11 +32,11 @@ class Ampel_model extends DB_Model
$query .= ' email = ? AND';
}
$query .= '
$query .= '(
(NOW()<(deadline+(COALESCE(verfallszeit,0) || \' days\')::interval)::date)
OR (verfallszeit IS NULL)
AND (NOW()>(deadline-(COALESCE(vorlaufzeit,0) || \' days\')::interval)::date)
OR (vorlaufzeit IS NULL AND NOW() < deadline)';
OR (vorlaufzeit IS NULL AND NOW() < deadline))';
$query .= ' ORDER BY deadline DESC';
@@ -50,7 +50,7 @@ class Ampel_model extends DB_Model
*/
public function execBenutzerSelect($benutzer_select)
{
if (isset($benutzer_select) && !empty(trim($benutzer_select)))
if (isset($benutzer_select) && !isEmptyString($benutzer_select))
{
return $this->execQuery($benutzer_select);
}
+19 -19
View File
@@ -11,7 +11,7 @@ class Akte_model extends DB_Model
$this->dbTable = 'public.tbl_akte';
$this->pk = 'akte_id';
}
/**
* getAkten
*/
@@ -19,7 +19,7 @@ class Akte_model extends DB_Model
{
// Checks if the operation is permitted by the API caller
if (isError($ent = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent;
$query = 'SELECT akte_id,
person_id,
dokument_kurzbz,
@@ -41,15 +41,15 @@ class Akte_model extends DB_Model
CASE WHEN inhalt is not null THEN true ELSE false END as inhalt_vorhanden
FROM public.tbl_akte
WHERE person_id = ?';
$parametersArray = array($person_id);
if (!is_null($dokument_kurzbz))
{
$query .= ' AND dokument_kurzbz = ?';
array_push($parametersArray, $dokument_kurzbz);
}
if (!is_null($stg_kz) && !is_null($prestudent_id))
{
$query .= ' AND dokument_kurzbz NOT IN (
@@ -65,9 +65,9 @@ class Akte_model extends DB_Model
)';
array_push($parametersArray, $stg_kz, $prestudent_id);
}
$query .= ' ORDER BY erstelltam';
return $this->execQuery($query, $parametersArray);
}
@@ -78,7 +78,7 @@ class Akte_model extends DB_Model
{
// Checks if the operation is permitted by the API caller
if (isError($ent = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent;
$query = 'SELECT a.akte_id,
a.person_id,
a.dokument_kurzbz,
@@ -103,17 +103,17 @@ class Akte_model extends DB_Model
INNER JOIN public.tbl_prestudent p USING(person_id)
LEFT JOIN public.tbl_dokumentprestudent dp USING(prestudent_id, dokument_kurzbz)
WHERE a.person_id = ?';
$parametersArray = array($person_id);
if (!empty($dokument_kurzbz))
if (!isEmptyString($dokument_kurzbz))
{
$query .= ' AND a.dokument_kurzbz = ?';
array_push($parametersArray, $dokument_kurzbz);
}
$query .= ' GROUP BY a.akte_id ORDER BY a.erstelltam';
return $this->execQuery($query, $parametersArray);
}
@@ -125,7 +125,7 @@ class Akte_model extends DB_Model
// Checks if the operation is permitted by the API caller
if (isError($ent = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent;
if (isError($ent = $this->isEntitled('campus.tbl_dms', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent;
$query = 'SELECT a.akte_id,
a.person_id,
a.dokument_kurzbz,
@@ -160,17 +160,17 @@ class Akte_model extends DB_Model
INNER JOIN (SELECT dms_id, MAX(version) AS version FROM campus.tbl_dms_version GROUP BY dms_id) dvv ON (d.dms_id = dvv.dms_id)
INNER JOIN campus.tbl_dms_version dv ON (dv.dms_id = dvv.dms_id AND dv.version = dvv.version)
WHERE a.person_id = ?';
$parametersArray = array($person_id);
if (!empty($dokument_kurzbz))
if (!isEmptyString($dokument_kurzbz))
{
$query .= ' AND a.dokument_kurzbz = ?';
array_push($parametersArray, $dokument_kurzbz);
}
$query .= ' GROUP BY a.akte_id, d.dms_id, dv.dms_id, dv.version ORDER BY a.erstelltam';
return $this->execQuery($query, $parametersArray);
}
+1 -1
View File
@@ -236,7 +236,7 @@ class Person_model extends DB_Model
{
$person = $persons->retval[$i];
if (!empty($person->sprache))
if (!isEmptyString($person->sprache))
{
$language = $person->sprache;
break;
@@ -8,6 +8,7 @@ class MessageToken_model extends CI_Model
{
/**
* Constructor
* NOTE: here are loaded libs, models, helpers, etc. because MessageToken_model extends directly the CI_Model
*/
public function __construct()
{
+4 -2
View File
@@ -51,10 +51,12 @@ class UDF_model extends DB_Model
$resultPerson = success('person');
$resultPrestudent = success('prestudent');
$person_id = $udfs['person_id'];
$person_id = null;
if (isset($udfs['person_id'])) $person_id = $udfs['person_id'];
unset($udfs['person_id']);
$prestudent_id = $udfs['prestudent_id'];
$prestudent_id = null;
if (isset($udfs['prestudent_id'])) $prestudent_id = $udfs['prestudent_id'];
unset($udfs['prestudent_id']);
$jsons = array();
+5 -6
View File
@@ -10,7 +10,7 @@ class Seed_Message
$this->fhc =& get_instance();
$this->fhc->load->helper('fhc');
}
public function seed($limit = 50)
{
echo "Seeding $limit messages ";
@@ -18,11 +18,11 @@ class Seed_Message
$db = $this->fhc->db->query('SELECT person_id FROM public.tbl_person LIMIT 100;');
$person = $db->result();
$num_persons = $db->num_rows();
for ($i = 0; $i < $limit; $i++)
{
echo ".";
$data = array
(
'subject' => $this->fhc->faker->sentence(4, true),
@@ -43,9 +43,9 @@ class Seed_Message
if (!$recipient)
show_error($recipient);
}
echo PHP_EOL;
}
public function truncate()
@@ -53,4 +53,3 @@ class Seed_Message
$this->fhc->db->query('DELETE FROM public.msg_message;');
}
}
@@ -16,7 +16,7 @@
?>
<tr>
<td>
<a href="outputAkteContent/<?php echo $dokument->akte_id ?>"><?php echo empty($dokument->titel) ? $dokument->bezeichnung : $dokument->titel ?></a>
<a href="outputAkteContent/<?php echo $dokument->akte_id ?>"><?php echo isEmptyString($dokument->titel) ? $dokument->bezeichnung : $dokument->titel ?></a>
</td>
<td><?php echo $dokument->dokument_bezeichnung ?></td>
<td><?php echo date_format(date_create($dokument->erstelltam), 'd.m.Y') ?></td>
@@ -222,8 +222,8 @@
'<a href="%s?person_id=%s&origin_page=%s&fhc_controller_id=%s">Details</a>',
site_url('system/infocenter/InfoCenter/showDetails'),
$datasetRaw->{'PersonId'},
$this->router->method,
$this->input->get('fhc_controller_id')
'index',
(isset($_GET['fhc_controller_id'])?$_GET['fhc_controller_id']:'')
);
if ($datasetRaw->{'SendDate'} == null)
@@ -156,8 +156,8 @@
'<a href="%s?person_id=%s&origin_page=%s&fhc_controller_id=%s">Details</a>',
site_url('system/infocenter/InfoCenter/showDetails'),
$datasetRaw->{'PersonId'},
$this->router->method,
$this->input->get('fhc_controller_id')
'freigegeben',
(isset($_GET['fhc_controller_id'])?$_GET['fhc_controller_id']:'')
);
if ($datasetRaw->{'SendDate'} == null)
@@ -21,7 +21,7 @@ $this->load->view(
</div>
</div>
<div id="data">
<?php if (empty($data)): ?>
<?php if ($data == null): ?>
<?php echo $this->p->t('infocenter', 'keineZugangsvoraussetzungenTxt'); ?>
<?php
else:
@@ -34,4 +34,4 @@ $this->load->view(
</div>
</body>
<?php $this->load->view('templates/FHC-Footer'); ?>
<?php $this->load->view('templates/FHC-Footer'); ?>
@@ -129,7 +129,7 @@
<div class="form-group">
<label><?php echo $this->p->t('infocenter', 'zgv') . ' ' . $this->p->t('global','datum') . ':'?></label>
<?php
$zgvdatum = empty($zgvpruefung->zgvdatum) ? "" : date_format(date_create($zgvpruefung->zgvdatum), 'd.m.Y');
$zgvdatum = isEmptyString($zgvpruefung->zgvdatum) ? "" : date_format(date_create($zgvpruefung->zgvdatum), 'd.m.Y');
if ($infoonly):
echo $zgvdatum;
else:
@@ -188,7 +188,7 @@
<div class="form-group">
<label><?php echo $this->p->t('infocenter', 'zgv') . ' ' . $this->p->t('lehre','master') . ' ' . $this->p->t('global','datum') . ':'?></label>
<?php
$zgvmadatum = empty($zgvpruefung->zgvmadatum) ? "" : date_format(date_create($zgvpruefung->zgvmadatum), 'd.m.Y');
$zgvmadatum = isEmptyString($zgvpruefung->zgvmadatum) ? "" : date_format(date_create($zgvpruefung->zgvmadatum), 'd.m.Y');
if ($infoonly):
echo $zgvmadatum;
else:
@@ -305,7 +305,7 @@
<div class="col-lg-6 text-right">
<?php
$disabled = $disabledTxt = '';
if (empty($zgvpruefung->prestudentstatus->bewerbung_abgeschicktamum))
if (isEmptyString($zgvpruefung->prestudentstatus->bewerbung_abgeschicktamum))
{
$disabled = 'disabled';
$disabledTxt = 'Die Bewerbung muss erst abgeschickt worden sein.';
+7 -7
View File
@@ -6,14 +6,14 @@ class Reihungstest_widget extends DropdownWidget
{
$this->load->model('crm/Reihungstest_model', 'ReihungstestModel');
$this->ReihungstestModel->addOrder('datum', 'DESC');
$this->addSelectToModel($this->ReihungstestModel, 'reihungstest_id', 'CONCAT(datum, \' \', uhrzeit, \' \', anmerkung)');
$parametersArray = array();
// If the parameters studiengang or studiensemester are given and are not empty
if (isset($widgetData) && is_array($widgetData)
&& ((isset($widgetData['studiengang']) && !empty($widgetData['studiengang']))
|| (isset($widgetData['studiensemester']) && !empty($widgetData['studiensemester']))))
&& ((isset($widgetData['studiengang']) && !isEmptyString($widgetData['studiengang']))
|| (isset($widgetData['studiensemester']) && !isEmptyString($widgetData['studiensemester']))))
{
if ($widgetData['studiengang'] != null)
{
@@ -30,14 +30,14 @@ class Reihungstest_widget extends DropdownWidget
// Set 0 = 1 in the where clause of the query
$parametersArray['0'] = '1';
}
$this->setElementsArray(
$this->ReihungstestModel->loadWhere($parametersArray),
true,
'Select a reihungstest...',
'No reihungstest found'
);
$this->loadDropDownView($widgetData);
}
}
}
+13 -16
View File
@@ -10,12 +10,12 @@ class HTMLWidget extends Widget
const HTML_DEFAULT_VALUE = ''; // Default value of the html element
const HTML_NAME = 'name'; // HTML name attribute
const HTML_ID = 'id'; // HTML id attribute
// External block definition
const EXTERNAL_BLOCK = 'externalBlock'; // External block name
const EXTERNAL_START_BLOCK_HTML_TAG = '<div>'; // External block start tag
const EXTERNAL_END_BLOCK_HTML_TAG = '</div>'; // External block end tag
// HTML attributes
const LABEL = 'title';
const REGEX = 'regex';
@@ -26,21 +26,18 @@ class HTMLWidget extends Widget
const MAX_LENGTH = 'max-length';
const MIN_LENGTH = 'min-length';
const PLACEHOLDER = 'placeholder';
/**
* It gets also the htmlArgs array as parameter, it will be used to set the HTML properties
*/
public function __construct($name, $args = array(), $htmlArgs = array())
{
parent::__construct($name, $args);
// Initialising HTML properties
$this->_setHtmlProperties($htmlArgs);
// Loads helper message to manage returning messages
$this->load->helper('message');
}
/**
* Initialising html properties, such as the id and name attributes of the HTML element
*/
@@ -50,19 +47,19 @@ class HTMLWidget extends Widget
if (!isset($this->_args[HTMLWidget::HTML_ARG_NAME]))
{
$this->_args[HTMLWidget::HTML_ARG_NAME] = array();
// Avoids that elements in a HTML page have the same name or id
$randomIdentifier = uniqid(rand(0, 1000));
$this->_args[HTMLWidget::HTML_ARG_NAME][HTMLWidget::HTML_ID] = $randomIdentifier;
$this->_args[HTMLWidget::HTML_ARG_NAME][HTMLWidget::HTML_NAME] = $randomIdentifier;
foreach($htmlArgs as $argName => $argValue)
{
$this->_args[HTMLWidget::HTML_ARG_NAME][$argName] = $argValue;
}
}
}
/**
* Prints an attribute name and eventually also the value extracted from $htmlArgs
* Set $isValuePresent to false the value should not be displayed
@@ -76,12 +73,12 @@ class HTMLWidget extends Widget
if ($isValuePresent === true)
{
$value = $htmlArgs[$attribute];
if (is_bool($value))
{
$value = $value ? 'true' : 'false';
}
echo sprintf('%s="%s"', $attribute, $value);
}
else
@@ -91,7 +88,7 @@ class HTMLWidget extends Widget
}
}
}
/**
* Prints the external block start tag
*/
@@ -103,7 +100,7 @@ class HTMLWidget extends Widget
echo HTMLWidget::EXTERNAL_START_BLOCK_HTML_TAG;
}
}
/**
* Prints the external block end tag
*/
@@ -115,4 +112,4 @@ class HTMLWidget extends Widget
echo HTMLWidget::EXTERNAL_END_BLOCK_HTML_TAG;
}
}
}
}
+7 -5
View File
@@ -88,7 +88,7 @@ if(is_user_logged_in())
obj.style.height = obj.contentWindow.document.body.scrollHeight + \'px\';
}
var html_content = \'<iframe src="'.APP_ROOT.'cis/private/tools/ampelverwaltung.php?verpflichtend=true" name="ampel" frameborder="0" width="100%" height="100% onload="resizeIframe(this) id="ampel_frame"></iframe><button id="close_button" class="btn btn-default" onclick="hide_ampel_div()">'.$p->t('tools/ampelClose').'</button>\';
var html_content = \'<iframe src="'.APP_ROOT.'cis/private/tools/ampelverwaltung.php?verpflichtend=true" name="ampel" frameborder="0" width="100%" height="100% onload="resizeIframe(this) id="ampel_frame"></iframe><button id="close_button" class="btn btn-default" onclick="hide_ampel_div()">'.$p->t('tools/ampelClose').'</button>\';
$("#ampel_div").html(html_content);
});
</script>';
@@ -100,15 +100,13 @@ if(is_user_logged_in())
top: 20%;
left: 10%;
right: 10%;
width: 80%;
height: 45%;
width: 70%;
height: 50%;
scrolling: no;
z-index: 1003;
background-color: #fefefe;
margin: auto;
text-align: center;
/*padding-top: 20px;*/
/*border: 3px solid black;*/
-webkit-box-shadow: 0px 0px 0px 2000px rgba(0,0,0,0.47);
-moz-box-shadow: 0px 0px 0px 2000px rgba(0,0,0,0.47);
box-shadow: 0px 0px 0px 2000px rgba(0,0,0,0.47);
@@ -124,6 +122,10 @@ if(is_user_logged_in())
font-size: 150%;
height: 50px;
width: 100%;
background-color: white;
border: none;
/*border-top: 4px solid black;*/
/*border-bottom: 4px solid black;*/
}
</style>';
}
+26 -33
View File
@@ -328,29 +328,36 @@ function typeWrite(span){
},randInt+4500);
}
$(document).ready(function(){
typeWrite('sancho_ampel_text');
});
</script>
</head>
<body style="font-family: Arial, Helvetica, sans-serif; font-size: 13px;">
<div class="container" >
<div class="container-fluid" style="padding: 0px;">
<?php
//title in CIS
if (!$is_popup)
echo '<h3>' . $p->t('tools/ampelsystem') . '</h3>';
//title in popup for mandatory ampeln
//***************************************** AROUSE SANCHO for mandatory ampeln
if ($is_popup)
echo '<p><p><h3>' . $p->t('tools/ampelPopupTitel'). '</h3><p><br></p>';
{
//sancho message if mandatory ampeln exist
if (count($user_ampel_arr) > 0)
{
echo '
<div>
<img src="../../../skin/images/sancho/sancho_header_du_hast_verpflichtende_ampeln.jpg" alt="sancho_verpflichtende_ampeln" style="width: 100%;">
</div>
<p><br><br></p>';
}
}
?>
<!--***************************************** PANEL-GROUP -->
<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true" style="padding-left: 15px; padding-right:15px;">
<!--***************************************** radiobuttons actual term / all -->
<?php
@@ -370,30 +377,7 @@ $(document).ready(function(){
<?php
} //end if
//***************************************** AROUSE SANCHO for mandatory ampeln
if ($is_popup)
{
//sancho message if mandatory ampeln exist
if (count($user_ampel_arr) == 1)
$ovdue_txt = 'ich habe 1 Nachricht entdeckt, die verpflichtend zu bestätigen ist.';
else if (count($user_ampel_arr) > 1)
$ovdue_txt = 'ich habe ' . count($user_ampel_arr) . ' Nachrichten entdeckt, die verpflichtend zu bestätigen sind.';
if (count($user_ampel_arr) > 0)
{
echo '
<div class="row">
<div class="col-xs-2">
<img src="../../../skin/images/sancho_round_right_red.png" alt="sancho_ampel_ueberfaellig" class="img-circle" style="width: 120px;">
</div>
<div class="col-xs-8" style="color: red; font-weight: bold; font-family: Courier New, Courier, monospace;">
<br><br><span id="sancho_ampel_text"><noscript>Hallo ' . $person->vorname . ', ' . $ovdue_txt . ' ' . $p->t('tools/ampelBitteBestaetigen'). '</noscript></span>
</div>
</div>
<p><br><br></p>';
}
}
//***************************************** COLLAPSED PANELS WITH AMPELN
$cnt = 1; //counter to set iterative id's
@@ -418,7 +402,17 @@ $(document).ready(function(){
</div>
</div>
</div>';
}
elseif ($cnt_active != 0 && !$is_popup)
{
echo '
<div class="panel">
<div class="row" style="margin-bottom: 15px; padding-left: 15px;">
<div class="panel-heading" style="background-color: transparent" role="tab" id="heading">
<h4>' . $p->t('tools/ampelAktuelleAmpeln'). '</h4>
</div>
</div>
</div>';
}
//fill panel with ampeln
@@ -435,6 +429,7 @@ $(document).ready(function(){
<div class="panel">
<div class="row" style="margin-bottom: 15px; padding-left: 15px;">
<div class="panel-heading" style="background-color: transparent" role="tab" id="heading">
<br>
<h4>' . $p->t('tools/ampelAbgelaufenTitel'). '</h4>
<small>' . $p->t('tools/ampelAbgelaufenTxt'). '</small>
</div>
@@ -492,8 +487,6 @@ $(document).ready(function(){
</button>
</form>
</div>
</div>
</div>
<?php
+11 -1
View File
@@ -40,7 +40,7 @@ define('XML_ROOT', 'http://www.fhcomlete.org/build/rdf/');
// Pfad zu Document Root
define('DOC_ROOT', '/var/www/html/build/');
// URL zu CIS
define('CIS_ROOT', 'http://www.fhcomlete.org/build/cis/');
define('CIS_ROOT', 'http://www.fhcomlete.org/build/');
// Externe Funktionen - Unterordner im Include-Verzeichnis
define('EXT_FKT_PATH', 'tw');
@@ -185,4 +185,14 @@ define('SIGNATUR_USER', 'username');
define('SIGNATUR_PASSWORD', 'password');
// Signaturprofil das verwendet werden soll
define('SIGNATUR_DEFAULT_PROFILE', 'FHC_AMT_GROSS_DE');
/**
* Datenverbund Anbindung
*/
// Code der Bildungseinrichtung
define('DVB_BILDUNGSEINRICHTUNG_CODE','XX');
// Username
define('DVB_USERNAME','username');
// Passwort
define('DVB_PASSWORD','passwort');
?>
+1
View File
@@ -25,6 +25,7 @@
*/
require_once(dirname(__FILE__).'/basis_db.class.php');
require_once(dirname(__FILE__).'/datum.class.php');
require_once(dirname(__FILE__).'/functions.inc.php');
class cronjob extends basis_db
{
+251 -23
View File
@@ -23,19 +23,25 @@
* Abfrage und Vergabe von Matrikelnummern
*/
require_once(dirname(__FILE__).'/basis_db.class.php');
require_once(dirname(__FILE__).'/person.class.php');
require_once(dirname(__FILE__).'/student.class.php');
require_once(dirname(__FILE__).'/studiensemester.class.php');
require_once(dirname(__FILE__).'/adresse.class.php');
require_once(dirname(__FILE__).'/webservicelog.class.php');
require_once(dirname(__FILE__).'/prestudent.class.php');
class dvb
class dvb extends basis_db
{
const DVB_URL_WEBSERVICE_OAUTH = 'https://stubei-q.portal.at/dvb/oauth/token';
const DVB_URL_WEBSERVICE_SVNR = 'https://stubei-q.portal.at/rws/0.1/simpleStudentBySozialVersicherungsnummer.xml';
const DVB_URL_WEBSERVICE_ERSATZKZ = 'https://stubei-q.portal.at/rws/0.1/simpleStudentByErsatzKennzeichen.xml';
const DVB_URL_WEBSERVICE_SVNR = 'https://stubei-q.portal.at/rws/0.2/simpleStudentBySozialVersicherungsnummer.xml';
const DVB_URL_WEBSERVICE_ERSATZKZ = 'https://stubei-q.portal.at/rws/0.2/simpleStudentByErsatzKennzeichen.xml';
const DVB_URL_WEBSERVICE_RESERVIERUNG = 'https://stubei-q.portal.at/dvb/matrikelnummern/1.0/reservierung.xml';
const DVB_URL_WEBSERVICE_MELDUNG = 'https://stubei-q.portal.at/dvb/matrikelnummern/1.0/meldung.xml';
public $authentication;
private $username;
private $password;
private $debug;
protected $debug;
public $debug_output = '';
/**
@@ -51,6 +57,170 @@ class dvb
$this->debug = $debug;
}
/**
* Versucht die Matrikelnummer für eine Person zu ermitteln.
* Wenn die Person noch keine Matrikelnummer besitzt, wird eine neue Matrikelnummer
* angefordert und der Person zugeordnet
* @param int $person_id ID der Person.
* @return boolean true wenn Erfolgreich, false im Fehlerfall
*/
public function assignMatrikelnummer($person_id)
{
$person = new person();
if (!$person->load($person_id))
{
$this->errormsg = $person->errormsg;
return false;
}
if ($person->svnr != '')
{
$matrikelnummer = $this->getMatrikelnrBySVNR($person->svnr);
if ($matrikelnummer === false && $this->errormsg != '')
{
$this->logRequest($person, 'getMatrikelnrBySVNR', false);
return false;
}
}
elseif ($person->ersatzkennzeichen != '')
{
$matrikelnummer = $this->getMatrikelnrByErsatzkennzeichen($person->ersatzkennzeichen);
if ($matrikelnummer === false && $this->errormsg != '')
{
$this->logRequest($person, 'getMatrikelnrByErsatzkennzeichen', false);
return false;
}
}
else
{
$this->errormsg = 'Person braucht SVNR oder Ersatzkennzeichen';
return false;
}
if ($matrikelnummer !== false && $matrikelnummer != '')
{
// Matrikelnummer wurde gefunden
// Bei Person speichern
$person->matr_nr = $matrikelnummer;
if ($person->save())
{
$this->logRequest($person, 'assignExistingMatrikelnummer', true, $matrikelnummer);
return true;
}
}
else
{
// Es wurde noch keine Matrikelnummer zu dieser Person zugeordnet
// Es wird eine neue Matrikelnummer aus dem Kontingent angefordert
// und an die Person vergeben
// Studienjahr ermitteln
$qry = "
SELECT
studiensemester_kurzbz, prestudent_id
FROM
public.tbl_student
JOIN public.tbl_prestudent USING(prestudent_id)
JOIN public.tbl_prestudentstatus USING(prestudent_id)
JOIN public.tbl_benutzer ON(tbl_student.student_uid = tbl_benutzer.uid)
WHERE
tbl_prestudent.person_id=".$this->db_add_param($person->person_id)."
AND tbl_benutzer.aktiv
AND tbl_prestudentstatus.status_kurzbz='Student'
AND tbl_prestudent.bismelden
ORDER BY tbl_prestudentstatus.datum desc LIMIT 1
";
$prestudent_id = '';
$studiensemester_kurzbz = '';
if ($result = $this->db_query($qry))
{
if ($row = $this->db_fetch_object($result))
{
$studiensemester_kurzbz = $row->studiensemester_kurzbz;
$prestudent_id = $row->prestudent_id;
}
else
{
$this->logRequest($person, 'assignNewMatrikelnummer', false);
$this->errormsg = 'Fehler beim Ermitteln des Studienjahrs für diese Person';
return false;
}
}
else
{
$this->logRequest($person, 'assignNewMatrikelnummer', false);
$this->errormsg = 'Fehler beim Ermitteln des Studienjahrs für diese Person';
return false;
}
$studienjahr = substr($studiensemester_kurzbz, 4);
$art = substr($studiensemester_kurzbz, 0, 2);
if ($art == 'SS')
$studienjahr = $studienjahr - 1;
// Erstaustattung im Jahr 2018. Alle davor bekommen 18er Nummern
if ($studienjahr < 2018)
$studienjahr = 2018;
// Neue Matrikelnummer aus Kontingent anfordern
$kontingent = $this->getKontingent(DVB_BILDUNGSEINRICHTUNG_CODE, $studienjahr);
if ($kontingent !== false && isset($kontingent[0]))
{
$person_meldung = new stdClass();
$person_meldung->matrikelnummer = $kontingent[0];
$person_meldung->vorname = $person->vorname;
$person_meldung->nachname = $person->nachname;
$person_meldung->geburtsdatum = $person->gebdatum;
$person_meldung->geschlecht = mb_strtoupper($person->geschlecht);
$person_meldung->staat = $person->staatsbuergerschaft;
if ($person->svnr != '')
$person_meldung->svnr = $person->svnr;
// PLZ der Meldeadresse laden
$adresse = new adresse();
if ($adresse->loadZustellAdresse($person->person_id))
$person_meldung->plz = $adresse->plz;
// ZGV Datum laden falls vorhanden
$prestudent = new prestudent();
if ($prestudent->load($prestudent_id) && $prestudent->zgvdatum != '')
{
$datum_obj = new datum();
$person_meldung->matura = $datum_obj->formatDatum($prestudent->zgvdatum, 'Ymd');
}
// Meldung der Vergabe der Matrikelnummer
if ($this->setMatrikelnummer(DVB_BILDUNGSEINRICHTUNG_CODE, $person_meldung))
{
// Matrikelnummer bei Person speichern
$person->matr_nr = $matrikelnummer;
if ($person->save())
{
$this->logRequest($person, 'assignNewMatrikelnummer', true, $matrikelnummer);
return true;
}
}
else
{
$this->logRequest($person, 'assignNewgMatrikelnummer', false, $person_meldung);
$this->errormsg .= 'Vergabe fehlgeschlagen';
return false;
}
}
else
{
$this->logRequest($person, 'assignNewgMatrikelnummer', false, $studienjahr);
$this->errormsg .= 'Failed to get Kontingent';
return false;
}
}
}
/**
* Performs a OAuth2 Authentication and returns the OAuth Bearer Token
* @return boolean true wenn erfolgreich, false im Fehlerfall
@@ -113,7 +283,8 @@ class dvb
}
else
{
$this->errormsg = 'Request Failed with HTTP Code:'.$curl_info['http_code'].' and Response:'.$json_response;
$this->errormsg = 'Authentication failed with HTTP Code:'.$curl_info['http_code'];
$this->errormsg .= ' and Response:'.$json_response;
return false;
}
}
@@ -145,10 +316,11 @@ class dvb
{
if ($this->tokenIsExpired())
{
$this->authenticate();
if (!$this->authenticate())
return false;
}
$this->debug('getMatirkelnrBySVNR');
$this->debug('getMatrikelnrBySVNR');
$curl = curl_init();
@@ -176,7 +348,9 @@ class dvb
$curl_info = curl_getinfo($curl);
curl_close($curl);
$this->debug('Response '.$curl_info['http_code']);
$this->debug('ResponseCode: '.$curl_info['http_code']);
$this->debug('ResponseData: '.print_r($response, true));
if ($curl_info['http_code'] == '200')
{
/* Example Response:
@@ -194,11 +368,22 @@ class dvb
$dom = new DOMDocument();
$dom->loadXML($response);
$namespace = 'http://www.brz.gv.at/datenverbund-unis';
$domnodes_matrikelnummer = $dom->getElementsByTagNameNS($namespace, 'matrikelNummer');
foreach ($domnodes_matrikelnummer as $row)
$domnodes_student = $dom->getElementsByTagNameNS($namespace, 'student');
foreach ($domnodes_student as $row_student)
{
// Found
return $row->textContent;
// Wenn nicht gesperrt und fix vergeben
$ingesamtpool = $row_student->getAttribute('inGesamtPool');
$gesperrt = $row_student->getAttribute('gesperrt');
if ($ingesamtpool == 'true' && $gesperrt == 'false')
{
$domnodes_matrikelnummer = $row_student->getElementsByTagNameNS($namespace, 'matrikelNummer');
foreach ($domnodes_matrikelnummer as $row)
{
// Found
return $row->textContent;
}
}
}
$this->errormsg = '';
@@ -220,7 +405,8 @@ class dvb
{
if ($this->tokenIsExpired())
{
$this->authenticate();
if (!$this->authenticate())
return false;
}
$this->debug('getMatrikelnrByErsatzkennzeichen');
@@ -248,7 +434,8 @@ class dvb
$xml_response = curl_exec($curl);
$curl_info = curl_getinfo($curl);
curl_close($curl);
$this->debug('Response: '.$curl_info['http_code']);
$this->debug('ResponseCode: '.$curl_info['http_code']);
$this->debug('ResponseData: '.print_r($xml_response, true));
if ($curl_info['http_code'] == '200')
{
@@ -315,12 +502,26 @@ class dvb
$dom = new DOMDocument();
$dom->loadXML($xml_response);
$namespace = 'http://www.brz.gv.at/datenverbund-unis';
$domnodes_matrikelnummer = $dom->getElementsByTagNameNS($namespace, 'matrikelNummer');
foreach ($domnodes_matrikelnummer as $row)
$domnodes_student = $dom->getElementsByTagNameNS($namespace, 'student');
foreach ($domnodes_student as $row_student)
{
// Found
return $row->textContent;
// Wenn nicht gesperrt und fix vergeben
$ingesamtpool = $row_student->getAttribute('inGesamtPool');
$gesperrt = $row_student->getAttribute('gesperrt');
if ($ingesamtpool == 'true' && $gesperrt == 'false')
{
$domnodes_matrikelnummer = $row_student->getElementsByTagNameNS($namespace, 'matrikelNummer');
foreach ($domnodes_matrikelnummer as $row)
{
// Found
return $row->textContent;
}
}
}
$this->errormsg = '';
return false;
}
else
{
@@ -342,7 +543,8 @@ class dvb
if ($this->tokenIsExpired())
{
$this->authenticate();
if (!$this->authenticate())
return false;
}
$curl = curl_init();
@@ -371,7 +573,8 @@ class dvb
$curl_info = curl_getinfo($curl);
curl_close($curl);
$this->debug('Response: '.$curl_info['http_code']);
$this->debug('ResponseCode: '.$curl_info['http_code']);
$this->debug('ResponseData: '.print_r($response, true));
/* 200 ok
<?xml version="1.0" encoding="UTF-8"?>
@@ -417,7 +620,8 @@ class dvb
if ($this->tokenIsExpired())
{
$this->authenticate();
if (!$this->authenticate())
return false;
}
$data = '<?xml version="1.0" encoding="UTF-8"?>
@@ -457,7 +661,8 @@ class dvb
$curl_info = curl_getinfo($curl);
curl_close($curl);
$this->debug('Response: '.$curl_info['http_code']);
$this->debug('ResponseCode: '.$curl_info['http_code']);
$this->debug('ResponseData: '.print_r($response, true));
if ($curl_info['http_code'] == '200')
{
@@ -491,7 +696,8 @@ class dvb
if ($this->tokenIsExpired())
{
$this->authenticate();
if (!$this->authenticate())
return false;
}
$data = '<?xml version="1.0" encoding="UTF-8"?>
@@ -651,4 +857,26 @@ class dvb
if ($this->debug)
$this->debug_output .= "\n<br>".date('Y-m-d H:i:s').': '.htmlentities($msg);
}
/**
* Erstellt einen Logeintrag
* @param object $person Personen objekt.
* @param string $typ Art des Requests.
* @param bool $result True wen Erfolgreich, false wenn Fehlerhaft.
* @param object $data Zusatzdaten die Übermittelt wurden und geloggt werden sollen.
* @return void
*/
public function logRequest($person, $typ, $result, $data = null)
{
$webservicelog = new webservicelog();
$webservicelog->webservicetyp_kurzbz = 'dvb';
$webservicelog->request_id = $person->person_id;
$webservicelog->beschreibung = $typ;
$webservicelog->request_data = ($result?'SUCCESS':'FAILED').' '.$this->errormsg;
if (!is_null($data))
$webservicelog->request_data .= ' '.print_r($data, true);
$webservicelog->save();
}
}
+19 -4
View File
@@ -63,6 +63,7 @@ class person extends basis_db
public $zugangscode = null; // varchar(32)
public $foto_sperre = false; // boolean
public $matr_nr; //varchar(32)
public $bpk; //varchar(255)
/**
* Konstruktor - Uebergibt die Connection und laedt optional eine Person
@@ -89,7 +90,8 @@ class person extends basis_db
$qry = "SELECT person_id, sprache, anrede, titelpost, titelpre, nachname, vorname, vornamen,
gebdatum, gebort, gebzeit, foto, anmerkung, homepage, svnr, ersatzkennzeichen,
familienstand, anzahlkinder, aktiv, insertamum, insertvon, updateamum, updatevon, ext_id,
geschlecht, staatsbuergerschaft, geburtsnation, kurzbeschreibung, zugangscode, foto_sperre, matr_nr
geschlecht, staatsbuergerschaft, geburtsnation, kurzbeschreibung, zugangscode, foto_sperre,
matr_nr, bpk
FROM public.tbl_person
WHERE person_id = " . $this->db_add_param($personId, FHC_INTEGER);
@@ -132,6 +134,7 @@ class person extends basis_db
$this->zugangscode = $row->zugangscode;
$this->foto_sperre = $this->db_parse_bool($row->foto_sperre);
$this->matr_nr = $row->matr_nr;
$this->bpk = $row->bpk;
}
else
{
@@ -278,6 +281,12 @@ class person extends basis_db
$this->errormsg = 'SVNR ist ungueltig';
return false;
}
if (mb_strlen($this->bpk) > 255)
{
$this->errormsg = 'BPK darf nicht laenger als 255 Zeichen sein';
return false;
}
}
if ($this->svnr != '')
@@ -425,7 +434,8 @@ class person extends basis_db
$qry = 'INSERT INTO public.tbl_person (sprache, anrede, titelpost, titelpre, nachname, vorname, vornamen,
gebdatum, gebort, gebzeit, foto, anmerkung, homepage, svnr, ersatzkennzeichen,
familienstand, anzahlkinder, aktiv, insertamum, insertvon, updateamum, updatevon,
geschlecht, geburtsnation, staatsbuergerschaft, kurzbeschreibung, zugangscode, foto_sperre, matr_nr)
geschlecht, geburtsnation, staatsbuergerschaft, kurzbeschreibung, zugangscode,
foto_sperre, matr_nr, bpk)
VALUES('.$this->db_add_param($this->sprache).','.
$this->db_add_param($this->anrede).','.
$this->db_add_param($this->titelpost).','.
@@ -454,7 +464,8 @@ class person extends basis_db
$this->db_add_param($this->kurzbeschreibung).','.
$this->db_add_param($this->zugangscode).','.
$this->db_add_param($this->foto_sperre, FHC_BOOLEAN).','.
$this->db_add_param($this->matr_nr).');';
$this->db_add_param($this->matr_nr).','.
$this->db_add_param($this->bpk).');';
}
else
{
@@ -492,7 +503,8 @@ class person extends basis_db
' kurzbeschreibung='.$this->db_add_param($this->kurzbeschreibung).','.
' foto_sperre='.$this->db_add_param($this->foto_sperre, FHC_BOOLEAN).','.
' zugangscode='.$this->db_add_param($this->zugangscode).','.
' matr_nr ='.$this->db_add_param($this->matr_nr).
' matr_nr ='.$this->db_add_param($this->matr_nr).','.
' bpk = '.$this->db_add_param($this->bpk).
' WHERE person_id='.$this->person_id.';';
}
@@ -592,6 +604,7 @@ class person extends basis_db
$l->kurzbeschreibung = $row->kurzbeschreibung;
$l->foto_sperre = $this->db_parse_bool($row->foto_sperre);
$l->matr_nr = $row->matr_nr;
$l->bpk = $row->bpk;
$this->personen[] = $l;
}
}
@@ -848,6 +861,7 @@ class person extends basis_db
$this->zugangscode = $row->zugangscode;
$this->foto_sperre = $this->db_parse_bool($row->foto_sperre);
$this->matr_nr = $row->matr_nr;
$this->bpk = $row->bpk;
}
else
{
@@ -965,6 +979,7 @@ class person extends basis_db
$this->updateaktivvon = $row->updateaktivvon;
$this->updateaktivam = $row->updateaktivam;
$this->aktivierungscode = $row->aktivierungscode;
$this->bpk = $row->bpk;
return true;
}
else
+1
View File
@@ -57,6 +57,7 @@ $this->phrasen['tools/ampelBitteBestaetigen']='Bitte bestätigen Sie diese jetzt
$this->phrasen['tools/ampelAbgelaufenTitel']='Abgelaufene oder bereits bestätigte Ampeln';
$this->phrasen['tools/ampelAbgelaufenTxt']='Sie können diese Ampeln weiterhin lesen, aber nicht mehr bestätigen.';
$this->phrasen['tools/ampelBestaetigtAbgelaufen']='Bereits bestätigt oder abgelaufen';
$this->phrasen['tools/ampelAktuelleAmpeln']='Aktuelle Ampeln';
$this->phrasen['tools/ampelKeineAktuellen']='Keine aktuellen Ampeln';
$this->phrasen['tools/ampelKeineAktuellenTxt']='Sie haben zur Zeit keine aktuellen Ampeln.';
$this->phrasen['tools/ampelClose']='Jetzt nicht';
+1
View File
@@ -59,6 +59,7 @@ $this->phrasen['tools/ampelBitteBestaetigen']='Please confirm now!';
$this->phrasen['tools/ampelAbgelaufenTitel']='Notifications expired or confirmed';
$this->phrasen['tools/ampelAbgelaufenTxt']='Notifications can still be read, but not confirmed anymore.';
$this->phrasen['tools/ampelBestaetigtAbgelaufen']='Almost confirmed or expired';
$this->phrasen['tools/ampelAktuelleAmpeln']='Actual notifications';
$this->phrasen['tools/ampelKeineAktuellen']='No current notifications.';
$this->phrasen['tools/ampelKeineAktuellenTxt']='You currently do not have any notifications.';
+1 -1
View File
@@ -48,7 +48,7 @@
float: left;
height: 50px;
padding-top: 15px;
padding-right: 12px;
padding-left: 7px;
font-size: 16px;
margin-right: 3px;
}
+6 -4
View File
@@ -11,6 +11,8 @@
/**
* Global function used by NavigationWidget JS to bind events to side menu elements
* NOTE: it is called from the NavigationWidget JS therefore must be a global function
* Be carefull about recursive function calls!!!
*/
function sideMenuHook()
{
@@ -32,10 +34,10 @@ function sideMenuHook()
}
else
{
// If a success and refreshSideMenu is a valid function then call it to refresh the side menu
if (typeof refreshSideMenu == "function")
// If a success and refreshSideMenuHook is a valid function then call it to refresh the side menu
if (typeof refreshSideMenuHook == "function")
{
refreshSideMenu();
refreshSideMenuHook();
}
}
}
@@ -486,7 +488,7 @@ var FHC_FilterWidget = {
filter_page: FHC_FilterWidget.getFilterPage()
},
{
successCallback: refreshSideMenu // NOTE: to be checked
successCallback: refreshSideMenuHook // NOTE: to be checked
}
);
}
+91 -49
View File
@@ -20,7 +20,8 @@ var FHC_NavigationWidget = {
* Renders the header menu (top horizontal menu)
*/
renderHeaderMenu: function() {
//
// Retrives the header menu array
FHC_AjaxClient.ajaxCallGet(
'system/Navigation/header',
{
@@ -28,24 +29,16 @@ var FHC_NavigationWidget = {
},
{
successCallback: function(data, textStatus, jqXHR) {
if (FHC_AjaxClient.hasData(data))
{
var strHeaderMenu = '';
jQuery.each(FHC_AjaxClient.getData(data), function(i, e) {
var headerEntry = '';
if (e['icon'] != 'undefined' && e['icon'] != '')
{
headerEntry += '<i class="navbar-brand-icon fa fa-' + e['icon'] + ' fa-fw"></i>';
}
var target = '';
if (e['target'] != null) target = e['target'];
headerEntry += '<a class="navbar-brand" href="' + e['link'] + '" target=' + target + '>' + e['description'] + '</a>';
$(".menu-header-items").append(headerEntry);
if (e != null) strHeaderMenu += FHC_NavigationWidget._buildHeaderMenuStructure(e);
});
$(".menu-header-items").html(strHeaderMenu);
}
}
}
@@ -56,7 +49,8 @@ var FHC_NavigationWidget = {
* Renders the side left menu
*/
renderSideMenu: function() {
//
// Retrives the left menu array
FHC_AjaxClient.ajaxCallGet(
'system/Navigation/menu',
{
@@ -64,39 +58,67 @@ var FHC_NavigationWidget = {
},
{
successCallback: function(data, textStatus, jqXHR) {
if (FHC_AjaxClient.hasData(data))
{
var strMenu = '';
FHC_NavigationWidget._printCollapseIcon(); // Applies bootstrap SB Admin 2 theme elements to the left menu
FHC_NavigationWidget._printCollapseIcon();
var strLeftMenu = '';
// Builds left menu
jQuery.each(FHC_AjaxClient.getData(data), function(i, e) {
if (e != null) strMenu += FHC_NavigationWidget._printNavItem(e);
if (e != null) strLeftMenu += FHC_NavigationWidget._buildLeftMenuStructure(e);
});
$("#side-menu").html(strMenu);
$("#side-menu").metisMenu();
$("#side-menu").html(strLeftMenu); // render left menu
$("#side-menu").metisMenu(); // call the Bootstrap SB Admin 2 theme renderer
}
// If this global function is present...
if (typeof sideMenuHook == 'function')
{
sideMenuHook();
sideMenuHook(); // ...then call it
}
}
}
);
},
/**
* Calls URL to retrive a refreshed menu array
*/
refreshSideMenuHook: function(url) {
FHC_AjaxClient.ajaxCallGet(
url,
{
navigation_page: FHC_NavigationWidget._getNavigationWidgetCalled()
},
{
successCallback: function(data, textStatus, jqXHR) {
FHC_NavigationWidget.renderSideMenu();
},
errorCallback: function(jqXHR, textStatus, errorThrown) {
alert(textStatus);
}
}
);
},
//------------------------------------------------------------------------------------------------------------------
// Private methods
/**
*
* Applies bootstrap SB Admin 2 theme elements to the left menu
*/
_printCollapseIcon: function() {
// Hiding/showing navigation menu - works only with sb admin 2 template!!
if(!$("#collapseicon").length)
$("#side-menu").parent().append('<div id="collapseicon" title="hide Menu" class="text-right" style="cursor: pointer; color: #337ab7"><i class="fa fa-angle-double-left fa-fw"></i></div>');
$("#side-menu").parent().append(
'<div id="collapseicon" title="hide Menu" class="text-right" style="cursor: pointer; color: #337ab7">' +
' <i class="fa fa-angle-double-left fa-fw"></i>' +
'</div>'
);
$("#collapseicon").click(function() {
$("#page-wrapper").css('margin-left', '0px');
@@ -114,48 +136,68 @@ var FHC_NavigationWidget = {
},
/**
*
* Recursively builds the header menu structure
*/
_printNavItem: function(item, depth = 1) {
_buildHeaderMenuStructure: function(item) {
strMenu = "";
var expanded = typeof item['expand'] != 'undefined' && item['expand'] === true ? ' active' : '';
var strHeaderMenu = '';
strMenu += '<li class="' + expanded + '">';
if (typeof item['subscriptLinkClass'] != 'undefined' && typeof item['subscriptDescription'] != 'undefined'
&& item['subscriptLinkClass'] != null && item['subscriptDescription'] != null)
if (item['icon'] != 'undefined' && item['icon'] != '')
{
strMenu += '<span>';
strHeaderMenu += '<i class="navbar-brand-icon fa fa-' + item['icon'] + ' fa-fw"></i>';
}
var target = '';
if (item['target'] != null) target = item['target'];
strMenu += '<a href="' + item['link'] + '"' + expanded + ' target="' + target + '">';
strHeaderMenu += '<a class="navbar-brand" href="' + item['link'] + '" target="' + target + '">' + item['description'] + '</a>';
return strHeaderMenu;
},
/**
* Recursively builds the left menu structure
*/
_buildLeftMenuStructure: function(item, depth = 1) {
strLeftMenu = "";
var expanded = item['expand'] != null && item['expand'] === true ? ' active' : '';
strLeftMenu += '<li class="' + expanded + '">';
if (item['subscriptLinkClass'] != null && item['subscriptDescription'] != null)
{
strLeftMenu += '<span>';
}
var target = '';
if (item['target'] != null) target = item['target'];
strLeftMenu += '<a href="' + item['link'] + '"' + expanded + ' target="' + target + '">';
if (item['icon'] != 'undefined')
{
strMenu += '<i class="fa fa-' + item['icon'] + ' fa-fw"></i> ';
strLeftMenu += '<i class="fa fa-' + item['icon'] + ' fa-fw"></i> ';
}
strMenu += item['description'];
strLeftMenu += item['description'];
if (typeof item['children'] != 'undefined' && Object.keys(item['children']).length > 0)
if (item['children'] != null && Object.keys(item['children']).length > 0)
{
strMenu += '<span class="fa arrow"></span>';
strLeftMenu += '<span class="fa arrow"></span>';
}
strMenu += '</a>';
strLeftMenu += '</a>';
if (typeof item['subscriptLinkClass'] != 'undefined' && typeof item['subscriptDescription'] != 'undefined'
&& item['subscriptLinkClass'] != null && item['subscriptDescription'] != null)
if (item['subscriptLinkClass'] != null && item['subscriptDescription'] != null)
{
strMenu += '<a class="' + item['subscriptLinkClass'] + ' menuSubscriptLink" value="' + item['subscriptLinkValue'] + '" href="#"> (' + item['subscriptDescription'] + ')</a>';
strMenu += '</span>';
strLeftMenu += '<a class="' + item['subscriptLinkClass'] + ' menuSubscriptLink" value="' + item['subscriptLinkValue'] + '" href="#">' +
' (' + item['subscriptDescription'] + ')' +
'</a>';
strLeftMenu += '</span>';
}
if (typeof item['children'] != 'undefined' && Object.keys(item['children']).length > 0)
if (item['children'] != null && Object.keys(item['children']).length > 0)
{
var level = '';
if (depth === 1)
@@ -167,18 +209,18 @@ var FHC_NavigationWidget = {
level = 'third';
}
strMenu += '<ul class="nav nav-' + level + '-level" ' + expanded + '>';
strLeftMenu += '<ul class="nav nav-' + level + '-level" ' + expanded + '>';
jQuery.each(item['children'], function(i, e) {
if (e != null) strMenu += FHC_NavigationWidget._printNavItem(e, ++depth);
if (e != null) strLeftMenu += FHC_NavigationWidget._buildLeftMenuStructure(e, ++depth);
});
strMenu += '</ul>';
strLeftMenu += '</ul>';
}
strMenu += '</li>';
strLeftMenu += '</li>';
return strMenu;
return strLeftMenu;
},
/**
@@ -3,26 +3,12 @@
*/
/**
* Refreshes the side menu
* NOTE: it is called from the FilterWidget therefore must be a global function
* Global function used by FilterWidget JS to refresh the side menu
* NOTE: it is called from the FilterWidget JS therefore must be a global function
*/
function refreshSideMenu()
function refreshSideMenuHook()
{
//
FHC_AjaxClient.ajaxCallGet(
'system/infocenter/InfoCenter/setNavigationMenuArrayJson',
{
navigation_page: FHC_NavigationWidget._getNavigationWidgetCalled()
},
{
successCallback: function(data, textStatus, jqXHR) {
FHC_NavigationWidget.renderSideMenu();
},
errorCallback: function(jqXHR, textStatus, errorThrown) {
alert(textStatus);
}
}
);
FHC_NavigationWidget.refreshSideMenuHook('system/infocenter/InfoCenter/setNavigationMenuArrayJson');
}
/**
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 800 KiB

Binary file not shown.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 640 KiB

After

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 602 KiB

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 619 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 642 KiB

After

Width:  |  Height:  |  Size: 96 KiB

+18 -3
View File
@@ -53,6 +53,7 @@ $staat = filter_input(INPUT_POST, 'staat');
$matura = filter_input(INPUT_POST, 'matura');
$svnr = filter_input(INPUT_POST, 'svnr');
$ersatzkennzeichen = filter_input(INPUT_POST, 'ersatzkennzeichen');
$person_id = filter_input(INPUT_POST, 'person_id');
?><!DOCTYPE html>
<html>
@@ -73,6 +74,7 @@ $ersatzkennzeichen = filter_input(INPUT_POST, 'ersatzkennzeichen');
<li><a href="datenverbund_client.php?action=getReservations">Matrikelnummer Reservierungen anzeigen</a></li>
<li><a href="datenverbund_client.php?action=getKontingent">Matrikelnummer Kontingent anfordern</a></li>
<li><a href="datenverbund_client.php?action=setMatrikelnummer">Matrikelnummer Vergabe melden</a></li>
<li><a href="datenverbund_client.php?action=assignMatrikelnummer">Gesamtprozess (Abfrage, ggf Vergabemeldung, Speichern bei Person)</a></li>
</ul>
<br><br>
<form action="<?php echo $_SERVER['PHP_SELF'].'?action='.$action; ?>" method="post">
@@ -87,7 +89,7 @@ $ersatzkennzeichen = filter_input(INPUT_POST, 'ersatzkennzeichen');
* @param int $maxlength Maximallaenge des Eingabefeldes.
* @return void
*/
function printrow($name, $title, $value, $hint = '', $maxlength = 15)
function printrow($name, $title, $value, $hint = '', $maxlength = 15, $type = 'text')
{
global $db;
@@ -95,14 +97,14 @@ $ersatzkennzeichen = filter_input(INPUT_POST, 'ersatzkennzeichen');
<tr>
<td align="right">'.$title.':</td>
<td>
<input name="'.$name.'" type="text" size="30" maxlength="'.$maxlength.'"
<input name="'.$name.'" type="'.$type.'" size="30" maxlength="'.$maxlength.'"
value="'.$db->convert_html_chars($value).'"> '.$hint.'
</td>
</tr>';
}
printrow('username', 'Username', $username, '', 100);
printrow('password', 'Passwort', $password, '', 100);
printrow('password', 'Passwort', $password, '', 100, 'password');
switch($action)
{
@@ -146,6 +148,10 @@ $ersatzkennzeichen = filter_input(INPUT_POST, 'ersatzkennzeichen');
printrow('matura', 'Maturadatum', $matura, 'Format: YYYYMMDD (optional)', 10);
break;
case 'assignMatrikelnummer':
printrow('person_id', 'PersonID', $person_id);
break;
default:
echo "Unknown action";
break;
@@ -232,6 +238,15 @@ if (isset($_REQUEST['submit']))
echo '<br><b>Fehlgeschlagen:</b>'.$dvb->errormsg;
break;
case 'assignMatrikelnummer':
if($dvb->assignMatrikelnummer($person_id))
{
echo '<br><b>OK</b>';
}
else
echo '<br><b>Fehlgeschlagen:</b>'.$dvb->errormsg;
break;
default:
echo "Unknown action";
break;
+27 -1
View File
@@ -2221,6 +2221,32 @@ if ($result = @$db->db_query("SELECT conname FROM pg_constraint WHERE conname =
}
}
// Webservicetyp dvb
if ($result = $db->db_query("SELECT * FROM system.tbl_webservicetyp WHERE webservicetyp_kurzbz='dvb'"))
{
if ($db->db_num_rows($result) == 0)
{
$qry = "INSERT INTO system.tbl_webservicetyp(webservicetyp_kurzbz, beschreibung) VALUES('dvb','Datenverbund');";
if(!$db->db_query($qry))
echo '<strong>WebserviceLog: '.$db->db_last_error().'</strong><br>';
else
echo 'Webservicelog Typ für Datenverbund hinzugefügt';
}
}
//Spalte bpk in public.tbl_person
if(!$result = @$db->db_query("SELECT bpk FROM public.tbl_person LIMIT 1"))
{
$qry = "ALTER TABLE public.tbl_person ADD COLUMN bpk varchar(255);
COMMENT ON COLUMN public.tbl_person.bpk IS 'Bereichsspezifisches Personenkennzeichen';";
if(!$db->db_query($qry))
echo '<strong>public.tbl_person: '.$db->db_last_error().'</strong><br>';
else
echo '<br>public.tbl_person: Spalte bpk hinzugefuegt';
}
// *** Pruefung und hinzufuegen der neuen Attribute und Tabellen
echo '<H2>Pruefe Tabellen und Attribute!</H2>';
@@ -2414,7 +2440,7 @@ $tabellen=array(
"public.tbl_ortraumtyp" => array("ort_kurzbz","hierarchie","raumtyp_kurzbz"),
"public.tbl_organisationseinheit" => array("oe_kurzbz", "oe_parent_kurzbz", "bezeichnung","organisationseinheittyp_kurzbz", "aktiv","mailverteiler","freigabegrenze","kurzzeichen","lehre","standort","warn_semesterstunden_frei","warn_semesterstunden_fix","standort_id"),
"public.tbl_organisationseinheittyp" => array("organisationseinheittyp_kurzbz", "bezeichnung", "beschreibung"),
"public.tbl_person" => array("person_id","staatsbuergerschaft","geburtsnation","sprache","anrede","titelpost","titelpre","nachname","vorname","vornamen","gebdatum","gebort","gebzeit","foto","anmerkung","homepage","svnr","ersatzkennzeichen","familienstand","geschlecht","anzahlkinder","aktiv","insertamum","insertvon","updateamum","updatevon","ext_id","bundesland_code","kompetenzen","kurzbeschreibung","zugangscode", "foto_sperre","matr_nr","zugangscode_timestamp","udf_values"),
"public.tbl_person" => array("person_id","staatsbuergerschaft","geburtsnation","sprache","anrede","titelpost","titelpre","nachname","vorname","vornamen","gebdatum","gebort","gebzeit","foto","anmerkung","homepage","svnr","ersatzkennzeichen","familienstand","geschlecht","anzahlkinder","aktiv","insertamum","insertvon","updateamum","updatevon","ext_id","bundesland_code","kompetenzen","kurzbeschreibung","zugangscode", "foto_sperre","matr_nr","zugangscode_timestamp","udf_values","bpk"),
"public.tbl_person_fotostatus" => array("person_fotostatus_id","person_id","fotostatus_kurzbz","datum","insertamum","insertvon","updateamum","updatevon"),
"public.tbl_personfunktionstandort" => array("personfunktionstandort_id","funktion_kurzbz","person_id","standort_id","position","anrede"),
"public.tbl_preincoming" => array("preincoming_id","person_id","mobilitaetsprogramm_code","zweck_code","firma_id","universitaet","aktiv","bachelorthesis","masterthesis","von","bis","uebernommen","insertamum","insertvon","updateamum","updatevon","anmerkung","zgv","zgv_ort","zgv_datum","zgv_name","zgvmaster","zgvmaster_datum","zgvmaster_ort","zgvmaster_name","program_name","bachelor","master","jahre","person_id_emergency","person_id_coordinator_dep","person_id_coordinator_int","code","deutschkurs1","deutschkurs2","research_area","deutschkurs3","ext_id"),
+109
View File
@@ -0,0 +1,109 @@
<?php
/* Copyright (C) 2018 fhcomplete.org
*
* 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: Andreas Oesterreicher < andreas.oesterreicher@technikum-wien.at >
*/
/**
* Holt die Ergebnisse des Matrikelnummer Clearings des Datenverbundes
*/
require_once('../config/vilesci.config.inc.php');
require_once('../include/functions.inc.php');
require_once('../include/benutzerberechtigung.class.php');
$uid = get_uid();
$rechte = new benutzerberechtigung();
$rechte->getBerechtigungen($uid);
if(!$rechte->isBerechtigt('admin', null, 'suid'))
die($rechte->errormsg);
$be = DVB_BILDUNGSEINRICHTUNG_CODE;
$username = DVB_USERNAME;
$passwort = DVB_PASSWORD;
$meldedatum = '20180415';
// OAuth Token holen
$curl = curl_init();
$url = 'https://stubei-q.portal.at/dvb/oauth/token?grant_type=client_credentials';
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
$headers = array(
'Accept: application/json',
'Content-Type: application/x-www-form-urlencoded',
'Authorization: Basic '.base64_encode($username.":".$passwort),
'User-Agent: FHComplete',
'Connection: Keep-Alive',
'Expect:',
'Content-Length: 0'
);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
$json_response = curl_exec($curl);
$curl_info = curl_getinfo($curl);
curl_close($curl);
if ($curl_info['http_code'] == '200')
{
$authentication = json_decode($json_response);
$token = $authentication->access_token;
}
else
{
echo 'Request Failed with HTTP Code:'.$curl_info['http_code'].' and Response:'.$json_response;
exit;
}
// Clearing Daten holen
$curl = curl_init();
$url = 'https://stubei-q.portal.at/rws/clearing/0.2/clearing-upload.xml';
$url .= '?be='.$be.'&meldedatum='.$meldedatum;
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
$headers = array(
'Accept: application/json',
'Authorization: Bearer '.$token,
'User-Agent: FHComplete',
'Connection: Keep-Alive',
'Expect:',
'Content-Length: 0'
);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
$response = curl_exec($curl);
$curl_info = curl_getinfo($curl);
curl_close($curl);
if ($curl_info['http_code'] == '200')
{
header("Content-type: application/xhtml+xml");
echo $response;
}
else
{
echo 'Request Failed with HTTP Code:'.$curl_info['http_code'].' and Response:'.$response;
return false;
}
+152
View File
@@ -0,0 +1,152 @@
<?php
/* Copyright (C) 2018 fhcomplete.org
*
* 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: Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at>,
*/
/**
* Clearing Import
* Importiert Daten aus dem Matrikelnummer Clearing
*/
require_once('../config/vilesci.config.inc.php');
require_once('../include/functions.inc.php');
require_once('../include/benutzerberechtigung.class.php');
require_once('../include/person.class.php');
$uid = get_uid();
$rechte = new benutzerberechtigung();
$rechte->getBerechtigungen($uid);
if(!$rechte->isBerechtigt('admin', null, 'suid'))
die($rechte->errormsg);
echo '<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Matrikelnummer Clearing Import</title>
</head>
<body>
<h1>Matrikelnummer Clearing Import</h1>
Über diese Seite kann das Ergebnis des Matrikelnummer Clearings importiert werden.
Wähle dazu das Antwort-XML des Matrikelnummer clearings aus, das importiert werden soll.
Matrikelnummer und BPK wird aus dem XML importiert.<br><br>';
echo '<form method="POST" enctype="multipart/form-data">
<input type="file" name="datei">
<input type="submit" value="Importieren" />';
if(isset($_FILES['datei']))
{
$db = new basis_db();
$dom = new DOMDocument();
$dom->load($_FILES['datei']['tmp_name']);
$studierende = $dom->getElementsByTagName('studierende');
if(isset($studierende[0]))
{
$domnodes_personen = $studierende[0]->getElementsByTagName('personen');
foreach($domnodes_personen as $row_person)
{
$personid_node = $row_person->getElementsByTagName('personId');
if(isset($personid_node[0]))
{
$node_bpk = $personid_node[0]->getElementsByTagName('bpk');
$node_personenkennzeichen = $personid_node[0]->getElementsByTagName('personenkennzeichen');
$node_matrikelnr = $personid_node[0]->getElementsByTagName('matrikelnummer');
$bpk = '';
$personenkennzeichen = '';
$matrikelnr = '';
if (isset($node_bpk[0]))
$bpk = $node_bpk[0]->textContent;
if (isset($node_personenkennzeichen[0]))
$personenkennzeichen = $node_personenkennzeichen[0]->textContent;
if (isset($node_matrikelnr[0]))
$matrikelnr = $node_matrikelnr[0]->textContent;
if($personenkennzeichen != '')
{
$qry = "
SELECT
person_id
FROM
campus.vw_student
WHERE
matrikelnr=".$db->db_add_param($personenkennzeichen);
if($result = $db->db_query($qry))
{
if($db->db_num_rows($result) == 1)
{
if($row = $db->db_fetch_object($result))
{
$person_id = $row->person_id;
$person = new person();
if($person->load($person_id))
{
$person->matr_nr = $matrikelnr;
if($bpk != '' && $bpk != '****************************')
$person->bpk = $bpk;
if($person->save())
{
echo '<br>Daten von '.$personenkennzeichen.' importiert';
}
else
{
echo '<br>Fehler beim Import von '.$personenkennzeichen.':'.$person->errormsg;
}
}
else
{
echo '<br>Person mit PersonID '.$person_id.' konnte nicht geladen werden';
}
}
else
{
echo '<br>Failed to get Results';
}
}
else
{
echo 'Person mit Perskz: '.$personenkennzeichen.' konnte nicht eindeutig gefunden werden';
}
}
else
{
echo 'Fehler beim Laden der Person mit Perskz: '.$personenkennzeichen.'';
}
}
else
{
echo '<br>Failed to get Personenkennzeichen';
}
}
else
{
echo '<br>personID Tag no present -> wrong xml?';
}
}
echo '<br>Import abgeschlossen';
}
else
{
echo '<br>studierende Tag not present -> wrong xml?';
}
}
echo '</body>
</html>';
+1
View File
@@ -29,6 +29,7 @@
require_once(dirname(__FILE__).'/../../config/vilesci.config.inc.php');
require_once(dirname(__FILE__).'/../../include/cronjob.class.php');
require_once(dirname(__FILE__).'/../../include/datum.class.php');
require_once(dirname(__FILE__).'/../../include/functions.inc.php');
$datum = new datum();
$cj = new cronjob();
+103
View File
@@ -0,0 +1,103 @@
<?php
/* Copyright (C) 2018 fhcomplete.org
*
* 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: Andreas Oesterreicher < andreas.oesterreicher@technikum-wien.at >
*/
/**
* Erfragt die Matrikelnummern von Personen beim Datenverbund
* Wenn keine bestehende Matrikelnummer gefunden wird, wird eine neue Matrikelnummer angefordert
*/
require_once(dirname(__FILE__).'/../../config/vilesci.config.inc.php');
require_once(dirname(__FILE__).'/../../include/basis_db.class.php');
require_once(dirname(__FILE__).'/../../include/dvb.class.php');
require_once(dirname(__FILE__).'/../../include/benutzerberechtigung.class.php');
require_once(dirname(__FILE__).'/../../include/datum.class.php');
if (!$db = new basis_db())
die('Es konnte keine Verbindung zum Server aufgebaut werden.');
$limit = '';
$debug = false;
// Wenn das Script nicht ueber Commandline gestartet wird, muss eine
// Authentifizierung stattfinden
if (php_sapi_name() != 'cli')
{
// Benutzerdefinierte Variablen laden
$user = get_uid();
loadVariables($user);
// Berechtigungen pruefen
$rechte = new benutzerberechtigung();
$rechte->getBerechtigungen($user);
if (!$rechte->isBerechtigt('admin', null, 'suid'))
die('Sie haben keine Berechtigung für diese Seite');
if(isset($_GET['debug']))
$debug = ($_GET['debug']=='true'?true:false);
if(isset($_GET['limit']) && is_numeric($_GET['limit']))
$limit = $_GET['limit'];
}
else
{
// Commandline Paramter parsen bei Aufruf ueber Cronjob
// zb php matrikelnummer.php --limit 100 --debug true
$longopt = array(
"limit:",
"debug:"
);
$commandlineparams = getopt('', $longopt);
if (isset($commandlineparams['limit']) && is_numeric($commandlineparams['limit']))
$limit = $commandlineparams['limit'];
if (isset($commandlineparams['debug']))
$debug = ($commandlineparams['debug']=='true'?true:false);
}
$matrikelnummer_added = 0;
$webservice = new dvb(DVB_USERNAME, DVB_PASSWORD, $debug);
$qry = "
SELECT
distinct person_id
FROM
public.tbl_person
JOIN public.tbl_benutzer USING(person_id)
JOIN public.tbl_student ON(tbl_student.student_uid=tbl_benutzer.uid)
WHERE
public.tbl_benutzer.aktiv = true
AND tbl_person.matr_nr is null
AND studiengang_kz<10000
AND EXISTS(SELECT 1 FROM public.tbl_prestudent WHERE person_id=tbl_person.person_id AND bismelden=true)";
if ($limit != '')
$qry.=" LIMIT ".$limit;
$db = new basis_db();
if ($result = $db->db_query($qry))
{
while($row = $db->db_fetch_object($result))
{
if($webservice->assignMatrikelnummer($row->person_id))
echo "\n<br>".$row->person_id.' OK';
else
echo "\n<br>".$row->person_id.' Failed:'.$webservice->errormsg;
}
}
if($debug)
echo $webservice->debug_output;