diff --git a/application/config/navigation.php b/application/config/navigation.php index b788dc40c..d76b8a7f2 100644 --- a/application/config/navigation.php +++ b/application/config/navigation.php @@ -27,7 +27,7 @@ $config['navigation_header'] = array( 'oehbeitragsverwaltung' => array( 'link' => site_url('codex/Oehbeitrag'), 'icon' => '', - 'description' => 'Öhbeitragsverwaltung', + 'description' => 'ÖH-Beitragsverwaltung', 'expand' => true, 'sort' => 20, 'requiredPermissions' => 'admin:w' @@ -102,6 +102,13 @@ $config['navigation_header'] = array( 'description' => 'BPK Wartung', 'sort' => 20, 'requiredPermissions' => 'admin:r' + ), + 'errormonitoring' => array( + 'link' => site_url('system/issues/Issues'), + 'description' => 'Fehler Monitoring', + 'expand' => true, + 'sort' => 30, + 'requiredPermissions' => 'system/issues_verwalten:r' ) ) ), @@ -133,13 +140,6 @@ $config['navigation_header'] = array( 'expand' => true, 'sort' => 20, 'requiredPermissions' => 'system/developer:r' - ), - 'errormonitoring' => array( - 'link' => site_url('system/issues/Issues'), - 'description' => 'Fehler Monitoring', - 'expand' => true, - 'sort' => 20, - 'requiredPermissions' => 'system/issues_verwalten:r' ) ) ) diff --git a/application/controllers/codex/Oehbeitrag.php b/application/controllers/codex/Oehbeitrag.php index fa27d1ebb..da8c63e08 100644 --- a/application/controllers/codex/Oehbeitrag.php +++ b/application/controllers/codex/Oehbeitrag.php @@ -4,7 +4,7 @@ if (! defined("BASEPATH")) exit("No direct script access allowed"); class Oehbeitrag extends Auth_Controller { - const STUDIENSEMESTER_START = 'WS2020'; + const STUDIENSEMESTER_START = 'WS2020'; // Öhbeitrage can be assigned beginning with this Studiensemester public function __construct() { @@ -23,6 +23,14 @@ class Oehbeitrag extends Auth_Controller $this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel'); $this->load->library('WidgetLib'); + + $this->loadPhrases( + array( + 'global', + 'ui', + 'oehbeitrag' + ) + ); } public function index() diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index cd88f814a..a69a43220 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -20,6 +20,7 @@ class InfoCenter extends Auth_Controller const INDEX_PAGE = 'index'; const FREIGEGEBEN_PAGE = 'freigegeben'; const REIHUNGSTESTABSOLVIERT_PAGE = 'reihungstestAbsolviert'; + const ABGEWIESEN_PAGE = 'abgewiesen'; const SHOW_DETAILS_PAGE = 'showDetails'; const SHOW_ZGV_DETAILS_PAGE = 'showZGVDetails'; const ZGV_UBERPRUEFUNG_PAGE = 'ZGVUeberpruefung'; @@ -107,6 +108,7 @@ class InfoCenter extends Auth_Controller array( 'index' => 'infocenter:r', 'freigegeben' => 'infocenter:r', + 'abgewiesen' => 'infocenter:r', 'reihungstestAbsolviert' => 'infocenter:r', 'showDetails' => 'infocenter:r', 'showZGVDetails' => 'lehre/zgvpruefung:r', @@ -203,6 +205,16 @@ class InfoCenter extends Auth_Controller $this->load->view('system/infocenter/infocenterFreigegeben.php'); } + /** + * Abgewiesen page of the InfoCenter tool + */ + public function abgewiesen() + { + $this->_setNavigationMenu(self::ABGEWIESEN_PAGE); // define the navigation menu for this page + + $this->load->view('system/infocenter/infocenterAbgewiesen.php'); + } + /** * */ @@ -297,6 +309,13 @@ class InfoCenter extends Auth_Controller } $persondata = $this->_loadPersonData($person_id); + + $checkPerson = $this->PersonModel->checkDuplicate($person_id); + + if (isError($checkPerson)) show_error(getError($checkPerson)); + + $duplicate = array('duplicated' => getData($checkPerson)); + $prestudentdata = $this->_loadPrestudentData($person_id); $this->DokumentModel->addOrder('bezeichnung'); @@ -305,7 +324,8 @@ class InfoCenter extends Auth_Controller $data = array_merge( $persondata, $prestudentdata, - $dokumentdata + $dokumentdata, + $duplicate ); $data[self::FHC_CONTROLLER_ID] = $this->getControllerId(); @@ -734,7 +754,7 @@ class InfoCenter extends Auth_Controller if (hasData($lastStatus) && hasData($statusgrresult)) { - //check if still Interessent + //check if still Interessent, Bewerber or Wartender if ($lastStatus->retval[0]->status_kurzbz === self::INTERESSENTSTATUS || $lastStatus->retval[0]->status_kurzbz === self::BEWERBERSTATUS || $lastStatus->retval[0]->status_kurzbz === self::WARTENDER) @@ -913,7 +933,8 @@ class InfoCenter extends Auth_Controller $this->_log($person_id, 'freigegeben', $logparams); - $this->_sendFreigabeMail($prestudent_id); + if (is_numeric($statusgrund_id) || $logdata['studiengang_typ'] === 'm') + $this->_sendFreigabeMail($prestudent_id); } } } @@ -1191,6 +1212,10 @@ class InfoCenter extends Auth_Controller { $this->_setNavigationMenu(self::REIHUNGSTESTABSOLVIERT_PAGE); } + elseif (strpos($navigation_page, self::ABGEWIESEN_PAGE) !== false) + { + $this->_setNavigationMenu(self::ABGEWIESEN_PAGE); + } $this->outputJsonSuccess('success'); } @@ -1414,12 +1439,14 @@ class InfoCenter extends Auth_Controller $freigegebenLink = site_url(self::INFOCENTER_URI.'/'.self::FREIGEGEBEN_PAGE); $reihungstestAbsolviertLink = site_url(self::INFOCENTER_URI.'/'.self::REIHUNGSTESTABSOLVIERT_PAGE); + $abgewiesenLink = site_url(self::INFOCENTER_URI.'/'.self::ABGEWIESEN_PAGE); $currentFilterId = $this->input->get(self::FILTER_ID); if (isset($currentFilterId)) { $freigegebenLink .= '?'.self::PREV_FILTER_ID.'='.$currentFilterId; $reihungstestAbsolviertLink .= '?'.self::PREV_FILTER_ID.'='.$currentFilterId; + $abgewiesenLink .= '?'.self::PREV_FILTER_ID.'='.$currentFilterId; } $this->navigationlib->setSessionMenu( @@ -1458,6 +1485,18 @@ class InfoCenter extends Auth_Controller null, // subscriptLinkValue '', // target 20 // sort + ), + 'abgewiesen' => $this->navigationlib->oneLevel( + 'Abgewiesene', // description + $abgewiesenLink, // link + null, // children + 'close', // icon + null, // subscriptDescription + false, // expand + null, // subscriptLinkClass + null, // subscriptLinkValue + '', // target + 30 // sort ) ) ); @@ -1483,6 +1522,8 @@ class InfoCenter extends Auth_Controller } if ($origin_page === self::ZGV_UBERPRUEFUNG_PAGE) $link = site_url(self::ZGV_UEBERPRUEFUNG_URI); + if ($origin_page === self::ABGEWIESEN_PAGE) + $link = site_url(self::INFOCENTER_URI.'/'.self::ABGEWIESEN_PAGE); $prevFilterId = $this->input->get(self::PREV_FILTER_ID); if (isset($prevFilterId)) @@ -1520,6 +1561,7 @@ class InfoCenter extends Auth_Controller $homeLink = site_url(self::INFOCENTER_URI.'/'.self::INDEX_PAGE); $freigegebenLink = site_url(self::INFOCENTER_URI.'/'.self::FREIGEGEBEN_PAGE); $absolviertLink = site_url(self::INFOCENTER_URI.'/'.self::REIHUNGSTESTABSOLVIERT_PAGE); + $abgewiesenLink = site_url(self::INFOCENTER_URI.'/'.self::ABGEWIESEN_PAGE); $prevFilterId = $this->input->get(self::PREV_FILTER_ID); if (isset($prevFilterId)) { @@ -1578,6 +1620,24 @@ class InfoCenter extends Auth_Controller ) ); } + if($page == self::ABGEWIESEN_PAGE) + { + $this->navigationlib->setSessionElementMenu( + 'abgewiesen', + $this->navigationlib->oneLevel( + 'Abgewiesene', // description + $abgewiesenLink, // link + null, // children + 'close', // icon + null, // subscriptDescription + false, // expand + null, // subscriptLinkClass + null, // subscriptLinkValue + '', // target + 40 // sort + ) + ); + } } /** @@ -2134,17 +2194,18 @@ class InfoCenter extends Auth_Controller { $statusgrund = $this->input->post('statusgrund'); $studiengang = $this->input->post('studiengang'); + $abgeschickt = $this->input->post('abgeschickt'); $personen = $this->input->post('personen'); $studienSemester = $this->variablelib->getVar('infocenter_studiensemester'); - if ($statusgrund === 'null' || $studiengang === 'null' || empty($personen)) - $this->terminateWithJsonError("Bitte Statusgrund, Studiengang und Personen auswählen."); + if ($statusgrund === 'null' || $studiengang === 'null' || $abgeschickt === 'null' || empty($personen)) + $this->terminateWithJsonError("Bitte füllen Sie alle Felder aus"); foreach($personen as $person) { - $prestudent = $this->PrestudentModel->getPrestudentByStudiengangAndPerson($studiengang, $person, $studienSemester); + $prestudent = $this->PrestudentModel->getPrestudentByStudiengangAndPerson($studiengang, $person, $studienSemester, $abgeschickt); - if(!hasData($prestudent)) + if (!hasData($prestudent)) continue; $prestudentData = getData($prestudent); diff --git a/application/controllers/system/issues/Issues.php b/application/controllers/system/issues/Issues.php index f942b50d9..e9764fb63 100644 --- a/application/controllers/system/issues/Issues.php +++ b/application/controllers/system/issues/Issues.php @@ -23,18 +23,21 @@ class Issues extends Auth_Controller $this->load->library('PermissionLib'); $this->load->library('WidgetLib'); + // Load models + $this->load->model('person/Benutzerfunktion_model', 'BenutzerfunktionModel'); + $this->load->model('organisation/Organisationseinheit_model', 'OrganisationseinheitModel'); + $this->loadPhrases( array( 'global', 'ui', - 'filter' + 'filter', + 'lehre', + 'person', + 'fehlermonitoring' ) ); - // Load models - $this->load->model('person/Benutzerfunktion_model', 'BenutzerfunktionModel'); - $this->load->model('organisation/Organisationseinheit_model', 'OrganisationseinheitModel'); - $this->_setAuthUID(); // sets property uid } diff --git a/application/libraries/FilterWidgetLib.php b/application/libraries/FilterWidgetLib.php index cdf0cac3c..d9a3428a0 100644 --- a/application/libraries/FilterWidgetLib.php +++ b/application/libraries/FilterWidgetLib.php @@ -203,7 +203,7 @@ class FilterWidgetLib // Loops in the session for all the filter widgets foreach ($filterWidgetsSession as $filterWidget => $filterWidgetData) { - // If this filter widget is not the currrent used filter widget and the it is expired... + // If this filter widget is not the current used filter widget and the it is expired... if ($this->_filterUniqueId != $filterWidget && $filterWidgetData[self::SESSION_TIMEOUT] <= time()) { cleanSessionElement(self::SESSION_NAME, $filterWidget); // ...remove it @@ -232,7 +232,7 @@ class FilterWidgetLib if ($filterId != null && is_numeric($filterId) && $filterId > 0) { $whereParameters = array( - 'filter_id' => $filterId + self::FILTER_ID => $filterId ); } else @@ -279,6 +279,18 @@ class FilterWidgetLib if ($definition == null && $whereParameters != null) { $definition = $this->_ci->FiltersModel->loadWhere($whereParameters); + + // Last chance!!! + if (!hasData($definition)) // If no data have been found until now the tries the most desperate query + { + $this->_ci->FiltersModel->addOrder('filter_id', 'ASC'); // sort on column filter_id to get the oldest + $whereParameters = array( + 'app' => $app, + 'dataset_name' => $datasetName + ); + + $definition = $this->_ci->FiltersModel->loadWhere($whereParameters); + } } return $definition; @@ -712,8 +724,11 @@ class FilterWidgetLib { $this->_ci->load->model('system/Filters_model', 'FiltersModel'); // to remove the filter definitions from DB - // delete it! - $this->_ci->FiltersModel->delete(array('filter_id' => $filterId)); + // Delete it from database + $this->_ci->FiltersModel->delete(array(self::FILTER_ID => $filterId)); + + // Delete it from session + $this->_dropFromSessionFilterWidgetById($filterId); $removeCustomFilter = true; } @@ -735,7 +750,7 @@ class FilterWidgetLib $session = $this->getSession(); // The filter currently stored in session (the one that is currently used) if ($session != null) { - // Loads the Fitlers model + // Loads the Filters model $this->_ci->load->model('system/Filters_model', 'FiltersModel'); // Loads all the filters related to this page (same dataset_name and same app name) @@ -761,7 +776,7 @@ class FilterWidgetLib '%s?%s=%s', site_url($navigationPage), self::FILTER_ID, - $filter->filter_id + $filter->{self::FILTER_ID} ) // link ); @@ -774,7 +789,7 @@ class FilterWidgetLib { $menuEntry['subscriptDescription'] = 'Remove'; $menuEntry['subscriptLinkClass'] = 'remove-custom-filter'; - $menuEntry['subscriptLinkValue'] = $filter->filter_id; + $menuEntry['subscriptLinkValue'] = $filter->{self::FILTER_ID}; $childrenPersonalArray[] = $menuEntry; // adds to personal filters menu array } } @@ -974,5 +989,29 @@ class FilterWidgetLib return $pos; } + + /** + * Remove from the session the given filter widget + */ + private function _dropFromSessionFilterWidgetById($filterId) + { + // Loads the session for all the filter widgets + $filterWidgetsSession = getSession(self::SESSION_NAME); + + // If something is present in session + if ($filterWidgetsSession != null) + { + // Loops in the session for all the filter widgets + foreach ($filterWidgetsSession as $filterWidget => $filterWidgetData) + { + // If this filter widget is not the one that we are looking for + if ($filterWidgetData[self::FILTER_ID] == $filterId) + { + cleanSessionElement(self::SESSION_NAME, $filterWidget); // ...remove it + break; // stop to search + } + } + } + } } diff --git a/application/libraries/UDFLib.php b/application/libraries/UDFLib.php index 827bdc989..c5f0d3e98 100644 --- a/application/libraries/UDFLib.php +++ b/application/libraries/UDFLib.php @@ -312,10 +312,10 @@ class UDFLib { $resultElement->{$columnName} = $columnValue; } - } - // And finally remove the UDFs column - unset($resultElement->{self::COLUMN_NAME}); + // And finally remove the UDFs column + unset($resultElement->{self::COLUMN_NAME}); + } } /** diff --git a/application/libraries/VorlageLib.php b/application/libraries/VorlageLib.php index 9679dff1c..d8d443a41 100644 --- a/application/libraries/VorlageLib.php +++ b/application/libraries/VorlageLib.php @@ -114,7 +114,7 @@ class VorlageLib if (!hasData($vorlage)) { // Builds where clause - $where = $this->_where($vorlage_kurzbz, $orgform_kurzbz, $sprache); + $where = $this->_where($vorlage_kurzbz); $vorlage = $this->ci->organisationseinheitlib->treeSearch( 'public', @@ -134,20 +134,11 @@ class VorlageLib /** * _where */ - private function _where($vorlage_kurzbz, $orgform_kurzbz, $sprache) + private function _where($vorlage_kurzbz) { // Builds where clause $where = "vorlage_kurzbz = ".$this->ci->VorlageModel->escape($vorlage_kurzbz); - if (is_null($sprache)) - { - $where .= " AND sprache IS NULL"; - } - else - { - $where .= " AND sprache = ".$this->ci->VorlageModel->escape($sprache); - } - $where .= " AND aktiv = true"; return $where; diff --git a/application/models/crm/Prestudent_model.php b/application/models/crm/Prestudent_model.php index 4111e5f19..5db9a98f1 100644 --- a/application/models/crm/Prestudent_model.php +++ b/application/models/crm/Prestudent_model.php @@ -611,7 +611,7 @@ class Prestudent_model extends DB_Model )); } - public function getPrestudentByStudiengangAndPerson($studiengang, $person, $studienSemester) + public function getPrestudentByStudiengangAndPerson($studiengang, $person, $studienSemester, $abgeschickt) { $query = "SELECT ps.prestudent_id FROM public.tbl_prestudentstatus pss @@ -621,7 +621,17 @@ class Prestudent_model extends DB_Model WHERE ps.person_id = ? AND UPPER((sg.typ || sg.kurzbz) || ':' || sp.orgform_kurzbz) = ? AND pss.studiensemester_kurzbz = ? - "; + AND"; + + if ($abgeschickt === 'true') + $query .= " EXISTS"; + else + $query .= " NOT EXISTS"; + + $query .= " (SELECT 1 FROM public.tbl_prestudentstatus spss + JOIN public.tbl_prestudent sps USING(prestudent_id) + WHERE sps.prestudent_id = ps.prestudent_id + AND spss.bewerbung_abgeschicktamum IS NOT NULL)"; return $this->execQuery($query, array($person, $studiengang, $studienSemester)); } @@ -655,4 +665,5 @@ class Prestudent_model extends DB_Model return $this->execQuery($query, array($prestudent_id)); } + } diff --git a/application/models/person/Person_model.php b/application/models/person/Person_model.php index 085c3f826..ec5522674 100644 --- a/application/models/person/Person_model.php +++ b/application/models/person/Person_model.php @@ -265,4 +265,19 @@ class Person_model extends DB_Model return success($result->vorname. ' '. $result->nachname); } + + public function checkDuplicate($person_id) + { + $qry = "SELECT sp.person_id + FROM public.tbl_person p + LEFT JOIN public.tbl_person sp ON p.vorname = sp.vorname + AND p.nachname = sp.nachname + AND p.gebdatum = sp.gebdatum + JOIN public.tbl_prestudent ps ON sp.person_id = ps.person_id + JOIN public.tbl_prestudentstatus pss ON ps.prestudent_id = pss.prestudent_id + WHERE p.person_id = ? AND sp.person_id != ? AND pss.status_kurzbz = ?"; + + + return $this->execQuery($qry, array($person_id, $person_id, 'Abbrecher')); + } } diff --git a/application/models/ressource/Betriebsmittelperson_model.php b/application/models/ressource/Betriebsmittelperson_model.php index 87915cfa8..1a97d9e38 100644 --- a/application/models/ressource/Betriebsmittelperson_model.php +++ b/application/models/ressource/Betriebsmittelperson_model.php @@ -18,7 +18,7 @@ class Betriebsmittelperson_model extends DB_Model * @param bool $isRetourniert False to retrieve only active Betriebsmittel. * @return array|bool */ - public function getBetriebsmittel($person_id, $betriebsmitteltyp = null, $isRetourniert = null) + public function getBetriebsmittel($person_id, $betriebsmitteltyp = null, $isRetourniert = null, $onlyAktiveBenutzer=false) { if (!is_numeric($person_id)) { @@ -28,8 +28,12 @@ class Betriebsmittelperson_model extends DB_Model $this->addJoin('wawi.tbl_betriebsmittel', 'betriebsmittel_id'); + if( $onlyAktiveBenutzer ) { + $this->addJoin('public.tbl_benutzer b', 'b.uid = wawi.tbl_betriebsmittelperson.uid AND b.aktiv = \'t\''); + } + $condition = ' - person_id = '. $this->escape($person_id). ' + wawi.tbl_betriebsmittelperson.person_id = '. $this->escape($person_id). ' '; if (is_string($betriebsmitteltyp)) { diff --git a/application/views/codex/oehbeitrag.php b/application/views/codex/oehbeitrag.php index 7cfb18fe8..8a697129e 100644 --- a/application/views/codex/oehbeitrag.php +++ b/application/views/codex/oehbeitrag.php @@ -12,6 +12,14 @@ $this->load->view( 'dialoglib' => true, 'ajaxlib' => true, 'navigationwidget' => true, + 'phrases' => array( + 'person' => array('vorname', 'nachname'), + 'global' => array('unbeschraenkt'), + 'ui' => array('bearbeiten', 'loeschen', 'speichern', 'entfernen'), + 'oehbeitrag' => array('oehbeitraegeFestgelegt', 'fehlerHolenOehbeitraege', 'fehlerHolenSemester', + 'fehlerHinzufuegenOehbeitrag', 'fehlerAktualisierenOehbeitrag', + 'fehlerLoeschenOehbeitrag') + ), 'customCSSs' => array('public/css/sbadmin2/tablesort_bootstrap.css', 'public/css/codex/oehbeitrag.css'), 'customJSs' => array('public/js/tablesort/tablesort.js', 'public/js/codex/oehbeitrag.js') ) @@ -28,23 +36,23 @@ $this->load->view(
| Gültig von | -Gültig bis | -Studierendenbetrag | -Versicherungsbetrag | -Aktion | +p->t('global', 'gueltigVon')) ?> | +p->t('global', 'gueltigBis')) ?> | +p->t('oehbeitrag', 'studierendenbetrag')) ?> | +p->t('oehbeitrag', 'versicherungsbetrag')) ?> | +p->t('ui', 'aktion')) ?> | - |
|---|