diff --git a/application/config/infocenter.php b/application/config/infocenter.php new file mode 100644 index 000000000..555c30996 --- /dev/null +++ b/application/config/infocenter.php @@ -0,0 +1,5 @@ + 'basis/variable:rw', 'getVar' => 'basis/variable:rw', - 'changeStudiensemesterVar' => 'basis/variable:rw' + 'changeStudiensemesterVar' => 'basis/variable:rw', + 'changeStudengangsTypVar' => 'basis/variable:rw' ) ); @@ -50,7 +51,9 @@ class Variables extends Auth_Controller public function getVar() { $name = $this->input->get('name'); - $this->outputJson($this->VariableModel->getVariables($this->_uid, array($name))); + $typ = $this->input->get('typ'); + + $this->outputJson($this->VariableModel->getVariables($this->_uid, array($name, $typ))); } /** @@ -66,6 +69,15 @@ class Variables extends Auth_Controller $this->outputJson($result); } + public function changeStudengangsTypVar() + { + $name = $this->input->post('name'); + $change = $this->input->post('change'); + + $result = $this->variablelib->changeStudengangsTypVar($this->_uid, $name, $change); + $this->outputJson($result); + } + /** * Retrieve the UID of the logged user and checks if it is valid */ diff --git a/application/libraries/VariableLib.php b/application/libraries/VariableLib.php index 2f038531b..a503eb999 100644 --- a/application/libraries/VariableLib.php +++ b/application/libraries/VariableLib.php @@ -100,6 +100,18 @@ class VariableLib return $result; } + public function changeStudengangsTypVar($uid, $name, $change) + { + $result = error('error when setting variable!'); + + if (isEmptyString($uid) || isEmptyString($name) || isEmptyString($change)) + return $result; + + $result = $this->_ci->VariableModel->setVariable($uid, $name, $change); + $this->_setVariable($uid, $name); + return $result; + } + /** * "Refreshes" variable value with given name by retrieving current value from db and saving it. * @param $uid diff --git a/application/models/system/Variablenname_model.php b/application/models/system/Variablenname_model.php index 7b2a2cf88..005834f67 100644 --- a/application/models/system/Variablenname_model.php +++ b/application/models/system/Variablenname_model.php @@ -11,7 +11,8 @@ class Variablenname_model extends DB_Model ORDER BY studienjahr_kurzbz, start ) sem WHERE start > now() - LIMIT 1;' + LIMIT 1;', + 'infocenter_studiensgangtyp' => 'SELECT infocenter_studiensgangtyp FROM public.tbl_variablename LIMIT 1' ); /** diff --git a/application/views/system/infocenter/infocenterData.php b/application/views/system/infocenter/infocenterData.php index 0c7030059..d9f12eb56 100644 --- a/application/views/system/infocenter/infocenterData.php +++ b/application/views/system/infocenter/infocenterData.php @@ -1,16 +1,17 @@ config->load('infocenter'); $APP = '\'infocenter\''; $REJECTED_STATUS = '\'Abgewiesener\''; $INTERESSENT_STATUS = '\'Interessent\''; - $STUDIENGANG_TYP = '\'b\''; + $STUDIENGANG_TYP = '\''.$this->variablelib->getVar('infocenter_studiensgangtyp').'\''; $TAETIGKEIT_KURZBZ = '\'bewerbung\', \'kommunikation\''; $LOGDATA_NAME = '\'Login with code\', \'Login with user\', \'New application\', \'Interessent rejected\''; $LOGDATA_NAME_PARKED = '\'Parked\''; $LOGDATA_NAME_ONHOLD = '\'Onhold\''; $LOGTYPE_KURZBZ = '\'Processstate\''; $STATUS_KURZBZ = '\'Wartender\', \'Bewerber\', \'Aufgenommener\', \'Student\''; - $ADDITIONAL_STG = '10021,10027'; + $ADDITIONAL_STG = $this->config->item('infocenter_studiengang_kz'); $AKTE_TYP = '\'identity\', \'zgv_bakk\''; $STUDIENSEMESTER = '\''.$this->variablelib->getVar('infocenter_studiensemester').'\''; @@ -142,10 +143,7 @@ AND pss.bewerbung_abgeschicktamum IS NOT NULL -- AND pss.bestaetigtam IS NULL AND ps.person_id = p.person_id - AND (sg.typ IN ('.$STUDIENGANG_TYP.') - OR - sg.studiengang_kz in('.$ADDITIONAL_STG.') - ) + AND pss.studiensemester_kurzbz = '.$STUDIENSEMESTER.' AND NOT EXISTS ( SELECT 1 diff --git a/application/views/system/infocenter/infocenterFreigegebenData.php b/application/views/system/infocenter/infocenterFreigegebenData.php index aab69b651..3b7ff1dbe 100644 --- a/application/views/system/infocenter/infocenterFreigegebenData.php +++ b/application/views/system/infocenter/infocenterFreigegebenData.php @@ -1,12 +1,13 @@ config->load('infocenter'); $APP = '\'infocenter\''; $INTERESSENT_STATUS = '\'Interessent\''; - $STUDIENGANG_TYP = '\'b\''; + $STUDIENGANG_TYP = '\''.$this->variablelib->getVar('infocenter_studiensgangtyp').'\''; $TAETIGKEIT_KURZBZ = '\'bewerbung\', \'kommunikation\''; $LOGDATA_NAME = '\'Login with code\', \'Login with user\', \'New application\''; $REJECTED_STATUS = '\'Abgewiesener\''; - $ADDITIONAL_STG = '10021,10027,10002'; + $ADDITIONAL_STG = $this->config->item('infocenter_studiengang_kz'); $STATUS_KURZBZ = '\'Wartender\', \'Bewerber\', \'Aufgenommener\', \'Student\''; $STUDIENSEMESTER = '\''.$this->variablelib->getVar('infocenter_studiensemester').'\''; @@ -109,10 +110,6 @@ WHERE pss.status_kurzbz = '.$INTERESSENT_STATUS.' AND pss.bewerbung_abgeschicktamum IS NOT NULL AND ps.person_id = p.person_id - AND (sg.typ IN ('.$STUDIENGANG_TYP.') - OR - sg.studiengang_kz in('.$ADDITIONAL_STG.') - ) AND pss.studiensemester_kurzbz = '.$STUDIENSEMESTER.' LIMIT 1 ) AS "StgAbgeschickt", diff --git a/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php b/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php index 22b122bb0..6b0918174 100644 --- a/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php +++ b/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php @@ -1,11 +1,12 @@ config->load('infocenter'); $APP = '\'infocenter\''; $INTERESSENT_STATUS = '\'Interessent\''; - $STUDIENGANG_TYP = '\'b\''; + $STUDIENGANG_TYP = '\''.$this->variablelib->getVar('infocenter_studiensgangtyp').'\''; $TAETIGKEIT_KURZBZ = '\'bewerbung\', \'kommunikation\''; $LOGDATA_NAME = '\'Login with code\', \'Login with user\', \'New application\''; - $ADDITIONAL_STG = '10021,10027'; + $ADDITIONAL_STG = $this->config->item('infocenter_studiengang_kz'); $STUDIENSEMESTER = '\''.$this->variablelib->getVar('infocenter_studiensemester').'\''; $query = ' @@ -90,10 +91,6 @@ WHERE pss.status_kurzbz = '.$INTERESSENT_STATUS.' AND pss.bewerbung_abgeschicktamum IS NOT NULL AND ps.person_id = p.person_id - AND (sg.typ IN ('.$STUDIENGANG_TYP.') - OR - sg.studiengang_kz in('.$ADDITIONAL_STG.') - ) AND pss.studiensemester_kurzbz = '.$STUDIENSEMESTER.' LIMIT 1 ) AS "StgAbgeschickt", diff --git a/public/js/infocenter/infocenterPersonDataset.js b/public/js/infocenter/infocenterPersonDataset.js index 87a40c0f1..03d1d13a1 100644 --- a/public/js/infocenter/infocenterPersonDataset.js +++ b/public/js/infocenter/infocenterPersonDataset.js @@ -20,22 +20,30 @@ if (FHC_JS_DATA_STORAGE_OBJECT.called_method == 'index') */ var InfocenterPersonDataset = { infocenter_studiensemester_variablename: 'infocenter_studiensemester', + infocenter_studienganstyp_variablename: 'infocenter_studiensgangtyp', /** * adds person table additional actions html (above and beneath it) */ - appendTableActionsHtml: function(infocenter_studiensemester) + appendTableActionsHtml: function(infocenter_studiensemester, infocenter_studiengangstyp) { var url = FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + "/system/messages/Messages/writeTemplate"; var formHtml = '
'; $("#datasetActionsTop").before(formHtml); - var studienSemesterHtml = '