diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index b13cf4d9b..3dc2919e1 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -207,6 +207,7 @@ class InfoCenter extends Auth_Controller $data[self::FHC_CONTROLLER_ID] = $this->getControllerId(); $data[self::ORIGIN_PAGE] = $origin_page; + $data[self::PREV_FILTER_ID] = $this->input->get(self::PREV_FILTER_ID); $this->load->view('system/infocenter/infocenterDetails.php', $data); } @@ -222,7 +223,18 @@ class InfoCenter extends Auth_Controller if (isError($result)) show_error($result->retval); - redirect('/'.self::INFOCENTER_URI.'?'.self::FHC_CONTROLLER_ID.'='.$this->getControllerId()); + $redirectLink = '/'.self::INFOCENTER_URI.'?'.self::FHC_CONTROLLER_ID.'='.$this->getControllerId(); + + // Force reload of Dataset after Unlock + $redirectLink .= '&reloadDataset=true'; + + $currentFilterId = $this->input->get(self::FILTER_ID); + if (isset($currentFilterId)) + { + $redirectLink .= '&'.self::FILTER_ID.'='.$currentFilterId; + } + + redirect($redirectLink); } /** @@ -234,7 +246,7 @@ class InfoCenter extends Auth_Controller $akte_id = $this->input->post('akte_id'); $formalgeprueft = $this->input->post('formal_geprueft'); - $json = false; + $json = null; if (isset($akte_id) && isset($formalgeprueft) && isset($person_id)) { @@ -247,7 +259,7 @@ class InfoCenter extends Auth_Controller if (isSuccess($result)) { - $json = $timestamp; + $json = is_null($timestamp) ? '' : $timestamp; $this->_log( $person_id, @@ -261,7 +273,7 @@ class InfoCenter extends Auth_Controller } } - $this->output->set_content_type('application/json')->set_output(json_encode($json)); + $this->outputJsonSuccess(array($json)); } /** @@ -272,7 +284,7 @@ class InfoCenter extends Auth_Controller { $prestudentdata = $this->_loadPrestudentData($person_id); - $this->output->set_content_type('application/json')->set_output(json_encode($prestudentdata['zgvpruefungen'])); + $this->outputJsonSuccess($prestudentdata['zgvpruefungen']); } /** @@ -283,7 +295,7 @@ class InfoCenter extends Auth_Controller { $prestudent = $this->PrestudentModel->getLastPrestudent($person_id, true); - $this->output->set_content_type('application/json')->set_output(json_encode($prestudent)); + $this->outputJson($prestudent); } /** @@ -299,10 +311,10 @@ class InfoCenter extends Auth_Controller $studiengangbezeichnung = $prestudentdata['studiengang_bezeichnung']; $data = array( - 'studiengang_bezeichnung' => $studiengangbezeichnung, - 'studiengang_kurzbz' => $studiengangkurzbz, - 'data' => null - ); + 'studiengang_bezeichnung' => $studiengangbezeichnung, + 'studiengang_kurzbz' => $studiengangkurzbz, + 'data' => null + ); if (hasData($studienordnung)) { @@ -319,13 +331,14 @@ class InfoCenter extends Auth_Controller { $prestudent_id = $this->input->post('prestudentid'); $change = $this->input->post('change'); + $json = false; - if (!is_numeric($change) || !is_numeric($prestudent_id)) - $result = error('Parameteres missing'); - else - $result = $this->PrestudentModel->changePrio($prestudent_id, intval($change)); + if (is_numeric($change) || is_numeric($prestudent_id)) + { + $json = $this->PrestudentModel->changePrio($prestudent_id, intval($change)); + } - $this->output->set_content_type('application/json')->set_output(json_encode($result)); + $this->outputJsonSuccess(array($json)); } /** @@ -403,7 +416,8 @@ class InfoCenter extends Auth_Controller $this->_log($logdata['person_id'], 'savezgv', array($logdata['studiengang_kurzbz'], $prestudent_id)); } } - $this->output->set_content_type('application/json')->set_output(json_encode($json)); + + $this->outputJson($json); } /** @@ -454,7 +468,8 @@ class InfoCenter extends Auth_Controller } } } - $this->output->set_content_type('application/json')->set_output(json_encode($json)); + + $this->outputJson($json); } /** @@ -521,9 +536,7 @@ class InfoCenter extends Auth_Controller // acceptresult returns null if no documents to accept if ($acceptresult !== null && isError($acceptresult)) - { - $json->error = 2; - } + $json->retval['nonCriticalErrors'] = 'error when accepting documents in FAS'; $logparams = array($prestudent_id, $logdata['studiengang_kurzbz'], ''); @@ -543,7 +556,7 @@ class InfoCenter extends Auth_Controller } } - $this->output->set_content_type('application/json')->set_output(json_encode($json)); + $this->outputJson($json); } /** @@ -557,7 +570,7 @@ class InfoCenter extends Auth_Controller $notiz_id ); - $this->output->set_content_type('application/json')->set_output(json_encode($result)); + $this->outputJson($result); } /** @@ -577,7 +590,7 @@ class InfoCenter extends Auth_Controller $this->_log($person_id, 'savenotiz', array($titel)); } - $this->output->set_content_type('application/json')->set_output(json_encode($result)); + $this->outputJson($result); } /** @@ -608,7 +621,7 @@ class InfoCenter extends Auth_Controller $this->_log($person_id, 'updatenotiz', array($titel)); } - $this->output->set_content_type('application/json')->set_output(json_encode($result)); + $this->outputJson($result); } /** @@ -696,9 +709,9 @@ class InfoCenter extends Auth_Controller */ public function getParkedDate($person_id) { - $result = $this->personloglib->getParkedDate($person_id); + $parkedDate = $this->personloglib->getParkedDate($person_id); - $this->output->set_content_type('application/json')->set_output(json_encode($result)); + $this->outputJsonSuccess(array($parkedDate)); } /** @@ -711,7 +724,7 @@ class InfoCenter extends Auth_Controller $result = $this->personloglib->park($person_id, date_format(date_create($date), 'Y-m-d'), self::TAETIGKEIT, self::APP, null, $this->_uid); - $this->output->set_content_type('application/json')->set_output(json_encode($result)); + $this->outputJson($result); } /** @@ -722,14 +735,8 @@ class InfoCenter extends Auth_Controller $person_id = $this->input->post('person_id'); $result = $this->personloglib->unPark($person_id); - if (isError($result)) - { - $this->outputJsonError($result); - } - else - { - $this->output->set_content_type('application/json')->set_output(json_encode(getData($result))); - } + + $this->outputJson($result); } /** @@ -741,14 +748,14 @@ class InfoCenter extends Auth_Controller $result = $this->StudienjahrModel->getCurrStudienjahr(); - $json = false; + $json = null; if (hasData($result)) { $json = $result->retval[0]->ende; } - $this->output->set_content_type('application/json')->set_output(json_encode($json)); + $this->outputJsonSuccess(array($json)); } /** @@ -1158,7 +1165,7 @@ class InfoCenter extends Auth_Controller show_error($notizen->retval); } - $notizen_bewerbung = $this->NotizModel->getNotizByTitel($person_id, 'Anmerkung zur Bewerbung'); + $notizen_bewerbung = $this->NotizModel->getNotizByTitel($person_id, 'Anmerkung zur Bewerbung%'); if (isError($notizen_bewerbung)) { @@ -1254,7 +1261,6 @@ class InfoCenter extends Auth_Controller $data = array ( 'zgvpruefungen' => $zgvpruefungen, - 'numberinteressenten' => $interessentenCount, 'abwstatusgruende' => $abwstatusgruende, 'intstatusgruende' => $intstatusgruende ); diff --git a/application/libraries/FiltersLib.php b/application/libraries/FiltersLib.php index b2ba1b9ef..975f27289 100644 --- a/application/libraries/FiltersLib.php +++ b/application/libraries/FiltersLib.php @@ -35,6 +35,7 @@ class FiltersLib const APP_PARAMETER = 'app'; const DATASET_NAME_PARAMETER = 'datasetName'; const FILTER_KURZBZ_PARAMETER = 'filterKurzbz'; + const DATASET_RELOAD_PARAMETER = 'reloadDataset'; // ...to specify permissions that are needed to use this FilterWidget const REQUIRED_PERMISSIONS_PARAMETER = 'requiredPermissions'; diff --git a/application/models/accounting/Kostenstelle_model.php b/application/models/accounting/Kostenstelle_model.php index 719d08835..592b6e9f2 100644 --- a/application/models/accounting/Kostenstelle_model.php +++ b/application/models/accounting/Kostenstelle_model.php @@ -52,7 +52,7 @@ class Kostenstelle_model extends DB_Model * @param null $geschaeftsjahr * @return array|null */ - public function getKostenstellenForGegitschaeftsjahrWithOe($geschaeftsjahr = null) + public function getKostenstellenForGeschaeftsjahrWithOe($geschaeftsjahr = null) { $this->load->model('organisation/geschaeftsjahr_model', 'GeschaeftsjahrModel'); @@ -106,6 +106,31 @@ class Kostenstelle_model extends DB_Model } } + /** + * Gets all Kostenstellen for which logged in user is berechtigt. + * @param null $berechtigung_kurzbz + * @param null $art + * @return array + */ + public function getKostenstellenBerechtigt($berechtigung_kurzbz = null, $art = null) + { + $allkostenstellen = $this->load(); + $kostenstellen = array(); + + if (hasData($allkostenstellen)) + { + foreach ($allkostenstellen->retval as $kostenstelle) + { + if ($this->permissionlib->isBerechtigt($berechtigung_kurzbz, $art, null, $kostenstelle->kostenstelle_id)) + { + $kostenstellen[] = $kostenstelle; + } + } + } + + return success($kostenstellen); + } + /** * Gets either given Geschaeftsjahr, current Geschaeftsjahr if not given, or chronologically last Geschaeftsjahr if there is no current * @param $geschaeftsjahr diff --git a/application/models/person/Notiz_model.php b/application/models/person/Notiz_model.php index 8df400933..a5453aaa1 100644 --- a/application/models/person/Notiz_model.php +++ b/application/models/person/Notiz_model.php @@ -156,7 +156,7 @@ class Notiz_model extends DB_Model $this->addJoin('public.tbl_notizzuordnung', 'notiz_id'); $this->addOrder('insertamum', 'DESC'); - return $this->loadWhere(array('person_id' => $person_id, 'titel' => $titel)); + return $this->loadWhere(array('person_id' => $person_id, 'titel LIKE' => $titel)); } // ------------------------------------------------------------------------------------------------------ diff --git a/application/views/system/infocenter/infocenterData.php b/application/views/system/infocenter/infocenterData.php index 67c4dcf38..793ca4aba 100644 --- a/application/views/system/infocenter/infocenterData.php +++ b/application/views/system/infocenter/infocenterData.php @@ -256,6 +256,7 @@ 'filter_id' => $this->input->get('filter_id'), 'requiredPermissions' => 'infocenter', 'datasetRepresentation' => 'tablesorter', + 'reloadDataset' => ($this->input->get('reloadDataset')=='true'?true:false), 'customMenu' => true, 'checkboxes' => 'PersonId', 'additionalColumns' => array('Details'), diff --git a/application/views/system/infocenter/infocenterDetails.php b/application/views/system/infocenter/infocenterDetails.php index f29be7127..9e708d076 100644 --- a/application/views/system/infocenter/infocenterDetails.php +++ b/application/views/system/infocenter/infocenterDetails.php @@ -68,9 +68,13 @@ if (isset($lockedby)): echo $this->p->t('global', 'wirdBearbeitetVon').': '; echo $lockedby; - if ($origin_page == 'index'): ?> + if ($origin_page == 'index'): + $unlockpath = 'unlockPerson/'.$stammdaten->person_id; + $unlockpath .= '?fhc_controller_id='.$fhc_controller_id; + $unlockpath .= '&filter_id='.$prev_filter_id; + ?>    - +  p->t('ui', 'freigeben')) ?> diff --git a/application/views/system/infocenter/zgvpruefungen.php b/application/views/system/infocenter/zgvpruefungen.php index 806f87410..86344d06b 100644 --- a/application/views/system/infocenter/zgvpruefungen.php +++ b/application/views/system/infocenter/zgvpruefungen.php @@ -387,19 +387,19 @@ if (isEmptyString($zgvpruefung->prestudentstatus->bewerbung_abgeschicktamum)) { $disabled = $disabledStg = 'disabled'; - $disabledTxt = $disabledStgTxt = 'Die Bewerbung muss erst abgeschickt worden sein.'; + $disabledTxt = $disabledStgTxt = $this->p->t('infocenter', 'bewerbungMussAbgeschickt'); } if ($studiengangtyp !== 'b') { $disabled = 'disabled'; - $disabledTxt = 'Nur Bachelorstudiengänge können freigegeben werden.'; + $disabledTxt = $this->p->t('infocenter', 'nurBachelorFreigeben'); // FIT-Lehrgänge: exceptions, can be freigegeben in Infocenter if (!in_array($studiengang_kz, $fit_programme_studiengaenge)) { $disabledStg = 'disabled'; - $disabledStgTxt = 'Nur Bachelorstudiengänge können freigegeben werden.'; + $disabledStgTxt = $this->p->t('infocenter', 'nurBachelorFreigeben'); } } ?> diff --git a/application/widgets/FilterWidget.php b/application/widgets/FilterWidget.php index 95d3672a0..b4e81788f 100644 --- a/application/widgets/FilterWidget.php +++ b/application/widgets/FilterWidget.php @@ -48,6 +48,7 @@ class FilterWidget extends Widget private $_datasetRepresentation; // dataset representation (ex: tablesorter, pivotUI, ...) private $_datasetRepresentationOptions; // dataset representation options for tablesorter, pivotUI, ... + private $_reloadDataset; // Force Reload of Dataset private static $_FilterWidgetInstance; // static property that contains the instance of itself @@ -156,6 +157,7 @@ class FilterWidget extends Widget $this->_datasetName = null; $this->_filterKurzbz = null; $this->_filterId = null; + $this->_reloadDataset = null; $this->_query = null; $this->_additionalColumns = null; $this->_columnsAliases = null; @@ -201,6 +203,11 @@ class FilterWidget extends Widget $this->_query = $args[FiltersLib::QUERY_PARAMETER]; } + if (isset($args[FiltersLib::DATASET_RELOAD_PARAMETER])) + { + $this->_reloadDataset = $args[FiltersLib::DATASET_RELOAD_PARAMETER]; + } + // Parameter is used to add extra columns to the dataset if (isset($args[FiltersLib::ADDITIONAL_COLUMNS]) && is_array($args[FiltersLib::ADDITIONAL_COLUMNS]) @@ -334,8 +341,10 @@ class FilterWidget extends Widget else // else if the filter loaded in session is the same that is being requested { // Get SESSION_RELOAD_DATASET from the session - $reloadDataset = $this->filterslib->getSessionElement(FiltersLib::SESSION_RELOAD_DATASET); - if ($reloadDataset === true) // if it's value is very true then reload the dataset + $sessionReloadDataset = $this->filterslib->getSessionElement(FiltersLib::SESSION_RELOAD_DATASET); + + // if Filter changed or reload is forced by parameter then reload the Dataset + if ($this->_reloadDataset === true || $sessionReloadDataset === true) { // Set as false to stop changing the dataset $this->filterslib->setSessionElement(FiltersLib::SESSION_RELOAD_DATASET, false); diff --git a/cis/ampel.php b/cis/ampel.php index 2f80092d5..6ef07e3ab 100644 --- a/cis/ampel.php +++ b/cis/ampel.php @@ -10,36 +10,35 @@ $p = new phrasen($sprache); ?> loadUserAmpel($user); - $rot=0; + $rot = 0; $gelb = 0; $gruen = 0; $verpflichtend = false; $cnt_verpflichtend = 0; $cnt_abgelaufen = 0; - $cnt_notConf_notOverdue = 0; //counts mandatory, not confirmed && not overdued ampeln (for popup) + $cnt_notConf_notOverdue = 0; //counts mandatory, not confirmed && not overdued ampeln (for popup) $datum = new datum(); $now = $datum->mktime_fromdate(date('Y-m-d')); - foreach($ampel->result as $row) + foreach ($ampel->result as $row) { - $deadline =$datum->mktime_fromdate($row->deadline); + $deadline = $datum->mktime_fromdate($row->deadline); $vorlaufzeit = $row->vorlaufzeit; $verfallszeit = $row->verfallszeit; $bestaetigt = $ampel->isBestaetigt($user, $row->ampel_id); @@ -50,37 +49,58 @@ if(is_user_logged_in()) $datum_liegt_nach_verfallszeit = false; if (!is_null($vorlaufzeit)) - $datum_liegt_vor_vorlaufzeit = $now < strtotime('-' . $vorlaufzeit . ' day', $deadline); + { + $datum_liegt_vor_vorlaufzeit = $now < strtotime('-'.$vorlaufzeit.' day', $deadline); + } if (!is_null($verfallszeit)) - $datum_liegt_nach_verfallszeit = $now > strtotime('+' . $verfallszeit . ' day', $deadline); + { + $datum_liegt_nach_verfallszeit = $now > strtotime('+'.$verfallszeit.' day', $deadline); + } //count mandatory - if($verpflichtend == 't') + if ($verpflichtend == 't') + { $cnt_verpflichtend++; + } //count overdue if ($datum_liegt_nach_verfallszeit) + { $cnt_abgelaufen++; + } //set status if ($bestaetigt) + { $gruen++; - else if ($now >= $deadline && !$datum_liegt_nach_verfallszeit && !$bestaetigt) - $rot++; - else if (!$datum_liegt_nach_verfallszeit && !$datum_liegt_vor_vorlaufzeit) - $gelb++; + } + else + { + if ($now >= $deadline && !$datum_liegt_nach_verfallszeit && !$bestaetigt) + { + $rot++; + } + else + { + if (!$datum_liegt_nach_verfallszeit && !$datum_liegt_vor_vorlaufzeit) + { + $gelb++; + } + } + } //count mandatory ampeln that are not confirmed and not overdue (for popup) if ($verpflichtend == 't' && !$bestaetigt && !$datum_liegt_nach_verfallszeit && !$datum_liegt_vor_vorlaufzeit) + { $cnt_notConf_notOverdue++; + } } - //if at least ONE mandatory notification, which is not overdue -> trigger notification-POPUP if ($cnt_notConf_notOverdue > 0) { - echo ' '; - echo ' '; - } + } - //show & color header ampel-link - if($rot > 0) - echo ''.$p->t("tools/ampelsystem").'  |  '; - elseif($gelb > 0) - echo ''.$p->t("tools/ampelsystem").'  |  '; - elseif($rot==0 || $rot <= $cnt_abgelaufen && $gelb==0) - echo ''.$p->t("tools/ampelsystem").'  |  '; - } + //show & color header ampel-link + if ($rot > 0) + { + echo ''.$p->t("tools/ampelsystem").'  |  '; + } + elseif ($gelb > 0) + { + echo ''.$p->t("tools/ampelsystem").'  |  '; + } + elseif ($rot == 0 || $rot <= $cnt_abgelaufen && $gelb == 0) + { + echo ''.$p->t("tools/ampelsystem").'  |  '; + } +} else { echo ""; diff --git a/content/lvplanung/lehrveranstaltungnotenoverlay.xul.php b/content/lvplanung/lehrveranstaltungnotenoverlay.xul.php index 4f9951d57..894540d3e 100644 --- a/content/lvplanung/lehrveranstaltungnotenoverlay.xul.php +++ b/content/lvplanung/lehrveranstaltungnotenoverlay.xul.php @@ -49,7 +49,8 @@ echo "