From 08c594148bfb0f20a113b670fc67911e5b023e2d Mon Sep 17 00:00:00 2001 From: ma0048 Date: Wed, 17 May 2023 08:41:04 +0200 Subject: [PATCH] - details bei abgewiesenen --- .../controllers/system/infocenter/InfoCenter.php | 11 +++++++++-- .../system/infocenter/infocenterAbgewiesenData.php | 11 +++++++++++ .../views/system/infocenter/infocenterDetails.php | 3 ++- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index 548b071d3..1e6639d25 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -314,7 +314,7 @@ class InfoCenter extends Auth_Controller show_error('Person does not exist!'); $origin_page = $this->input->get(self::ORIGIN_PAGE); - if ($origin_page == self::INDEX_PAGE) + if (in_array($origin_page, array(self::INDEX_PAGE, self::ABGEWIESEN_PAGE))) { // mark person as locked for editing $result = $this->PersonLockModel->lockPerson($person_id, $this->_uid, self::APP); @@ -359,7 +359,14 @@ class InfoCenter extends Auth_Controller if (isError($result)) show_error(getError($result)); - $redirectLink = '/'.self::INFOCENTER_URI.'?'.self::FHC_CONTROLLER_ID.'='.$this->getControllerId(); + $origin_page = $this->input->get(self::ORIGIN_PAGE); + + if ($origin_page === self::ABGEWIESEN_PAGE) + $redirectLink = self::INFOCENTER_URI. '/' .self::ABGEWIESEN_PAGE; + else + $redirectLink = '/'.self::INFOCENTER_URI; + + $redirectLink .= '?'.self::FHC_CONTROLLER_ID.'='.$this->getControllerId(); // Force reload of Dataset after Unlock $redirectLink .= '&'.self::KEEP_TABLESORTER_FILTER.'=true'; diff --git a/application/views/system/infocenter/infocenterAbgewiesenData.php b/application/views/system/infocenter/infocenterAbgewiesenData.php index d09f0f41e..94d3d6ee1 100644 --- a/application/views/system/infocenter/infocenterAbgewiesenData.php +++ b/application/views/system/infocenter/infocenterAbgewiesenData.php @@ -70,6 +70,7 @@ $query = ' 'requiredPermissions' => 'infocenter', 'datasetRepresentation' => 'tablesorter', 'checkboxes' => 'PersonId', + 'additionalColumns' => array('Details'), 'columnsAliases' => array( 'PersonId', 'PreStudentID', @@ -82,6 +83,16 @@ $query = ' ), 'formatRow' => function($datasetRaw) { + /* NOTE: Dont use $this here for PHP Version compatibility */ + $datasetRaw->{'Details'} = sprintf( + 'Details', + site_url('system/infocenter/InfoCenter/showDetails'), + $datasetRaw->{'PersonId'}, + 'abgewiesen', + (isset($_GET['fhc_controller_id']) ? $_GET['fhc_controller_id'] : ''), + (isset($_GET['filter_id']) ? $_GET['filter_id'] : '') + ); + if ($datasetRaw->{'Nachricht'} === null) { $datasetRaw->{'Nachricht'} = 'Nein'; diff --git a/application/views/system/infocenter/infocenterDetails.php b/application/views/system/infocenter/infocenterDetails.php index 401e34099..c61bb3cd2 100644 --- a/application/views/system/infocenter/infocenterDetails.php +++ b/application/views/system/infocenter/infocenterDetails.php @@ -57,10 +57,11 @@ if (isset($lockedby)): echo $this->p->t('global', 'wirdBearbeitetVon').': '; echo $lockedby; - if ($origin_page == 'index'): + if (in_array($origin_page, array('index', 'abgewiesen'))): $unlockpath = 'unlockPerson/'.$stammdaten->person_id; $unlockpath .= '?fhc_controller_id='.$fhc_controller_id; $unlockpath .= '&filter_id='.$prev_filter_id; + $unlockpath .= '&origin_page='.$origin_page; ?>